-
Notifications
You must be signed in to change notification settings - Fork 589
feat(cli): disable progress by default if no tty #5066
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the CLI user experience by automatically disabling progress output when running without a TTY (e.g., in scripts, CI/CD pipelines, or when output is redirected). This prevents binary spinner characters and other TTY-specific formatting from appearing in logs and non-interactive environments.
Key Changes:
- Modified the default value for the
--progressflag to be dynamically determined based on TTY detection - Progress is now disabled by default when stdout is not a terminal, but can still be explicitly enabled via the flag
4e2850c to
dbe8b64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
|
Tested by running "kopia snapshot create --all" and verifying that previous behavior was intact (spinner and progress). Then ran "kopia snapshot create --all | cat" and verified that progress messages and spinner were disabled. |
|
this is a great idea |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5066 +/- ##
==========================================
+ Coverage 75.86% 77.70% +1.84%
==========================================
Files 470 548 +78
Lines 37301 31462 -5839
==========================================
- Hits 28299 24449 -3850
+ Misses 7071 4959 -2112
- Partials 1931 2054 +123 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
please fix the linter issues and we can merge it, LGTM |
When running without a tty, disable progress by default. The progress includes binary characters such as a spinner that do not display properly without a tty.
90a2caf to
d227611
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Thank you! Long time kopia user, first time contributor (and also first time to a Go project) :-) Fixed the lint issues, sorry about that! |
When running without a tty, disable progress by default. The progress includes binary characters such as a spinner that do not display properly without a tty.
Resolves #3653