Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
May 11, 2024
Merged

Conversation

lukekarrys
Copy link
Contributor

@lukekarrys lukekarrys commented May 10, 2024

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 owner May 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 lukekarrys changed the title lk/stdout tty progress fix: require stdout to be a TTY for progress May 10, 2024
@npm-cli-bot
Copy link
Collaborator

npm-cli-bot commented May 10, 2024

no statistically significant performance changes detected

timing results
app-large clean lock-only cache-only modules-only no-lock no-cache no-modules no-clean show-version run-script cache-only
peer-deps
no-clean
audit
npm@latest 27.111 ±0.09 10.826 ±0.04 12.038 ±0.10 1.581 ±0.02 1.553 ±0.01 1.302 ±0.02 8.309 ±0.04 1.306 ±0.02 0.141 ±0.00 0.165 ±0.00 13.509 ±0.21 3.239 ±1.64
#7507 27.850 ±0.07 10.758 ±0.02 11.783 ±0.02 1.603 ±0.07 1.557 ±0.04 1.272 ±0.00 8.283 ±0.01 1.284 ±0.01 0.138 ±0.00 0.165 ±0.00 14.896 ±0.24 2.158 ±0.12
app-medium clean lock-only cache-only modules-only no-lock no-cache no-modules no-clean show-version run-script cache-only
peer-deps
no-clean
audit
npm@latest 21.800 ±0.08 8.033 ±0.00 8.916 ±0.02 1.516 ±0.03 1.511 ±0.00 1.414 ±0.00 5.816 ±0.03 1.321 ±0.02 0.140 ±0.00 0.166 ±0.00 9.455 ±0.11 2.797 ±1.16
#7507 22.023 ±0.15 8.045 ±0.00 8.922 ±0.04 1.520 ±0.00 1.506 ±0.01 1.413 ±0.01 5.829 ±0.04 1.320 ±0.02 0.140 ±0.00 0.166 ±0.00 10.192 ±0.14 2.021 ±0.02

@lukekarrys lukekarrys merged commit e3721c2 into latest May 11, 2024
23 checks passed
@lukekarrys lukekarrys deleted the lk/stdout-tty-progress branch May 11, 2024 04:08
@github-actions github-actions bot mentioned this pull request May 11, 2024
Sign up for free to 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