Skip to content

fix: require stdout to be a TTY for progress - #7507

Merged
lukekarrys merged 2 commits into
latestfrom
lk/stdout-tty-progress
May 11, 2024
Merged

fix: require stdout to be a TTY for progress#7507
lukekarrys merged 2 commits into
latestfrom
lk/stdout-tty-progress

Conversation

@lukekarrys

@lukekarryslukekarrys commented May 10, 2024

Copy link
Copy Markdown
Contributor

Progress is shown on stderr but looks weird when stdout is piped to
another command. So we should only show it by default if both streams
are TTYs.

Here's an example from my terminal to highlight the issue:

❯ npm view tiny-tarball --json | jq .name
⠼"tiny-tarball"
❯ npmlocal view tiny-tarball --json | jq .name
"tiny-tarball"

@lukekarrys
lukekarrys requested a review from a team as a code ownerMay 10, 2024 20:01
Progress is shown on stderr but looks weird when stdout is piped to
another command. So we should only show it by default if both streams
are TTYs.
@lukekarrys
lukekarrysforce-pushed the lk/stdout-tty-progress branch from d8e69dd to dd7958fCompareMay 10, 2024 20:02
@lukekarryslukekarrys changed the title lk/stdout tty progressfix: require stdout to be a TTY for progressMay 10, 2024
@npm-cli-bot

npm-cli-bot commented May 10, 2024

Copy link
Copy Markdown
Collaborator

no statistically significant performance changes detected

timing results
app-largecleanlock-onlycache-onlymodules-onlyno-lockno-cacheno-modulesno-cleanshow-versionrun-scriptcache-only
peer-deps
no-clean
audit
npm@latest27.111 ±0.0910.826 ±0.0412.038 ±0.101.581 ±0.021.553 ±0.011.302 ±0.028.309 ±0.041.306 ±0.020.141 ±0.000.165 ±0.0013.509 ±0.213.239 ±1.64
#750727.850 ±0.0710.758 ±0.0211.783 ±0.021.603 ±0.071.557 ±0.041.272 ±0.008.283 ±0.011.284 ±0.010.138 ±0.000.165 ±0.0014.896 ±0.242.158 ±0.12
app-mediumcleanlock-onlycache-onlymodules-onlyno-lockno-cacheno-modulesno-cleanshow-versionrun-scriptcache-only
peer-deps
no-clean
audit
npm@latest21.800 ±0.088.033 ±0.008.916 ±0.021.516 ±0.031.511 ±0.001.414 ±0.005.816 ±0.031.321 ±0.020.140 ±0.000.166 ±0.009.455 ±0.112.797 ±1.16
#750722.023 ±0.158.045 ±0.008.922 ±0.041.520 ±0.001.506 ±0.011.413 ±0.015.829 ±0.041.320 ±0.020.140 ±0.000.166 ±0.0010.192 ±0.142.021 ±0.02

@lukekarrys
lukekarrys merged commit e3721c2 into latestMay 11, 2024
@lukekarrys
lukekarrys deleted the lk/stdout-tty-progress branch May 11, 2024 04:08
@github-actionsgithub-actionsBot mentioned this pull request May 11, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@lukekarrys@npm-cli-bot@wraithgar