Skip to content

Conversation

@presto8
Copy link

@presto8 presto8 commented Dec 8, 2025

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

Copilot AI review requested due to automatic review settings December 8, 2025 22:18
Copy link

Copilot AI left a 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 --progress flag 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

@presto8 presto8 force-pushed the no-progress-without-tty branch 2 times, most recently from 4e2850c to dbe8b64 Compare December 8, 2025 22:33
Copilot AI review requested due to automatic review settings December 8, 2025 22:33
Copy link

Copilot AI left a 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.

@presto8
Copy link
Author

presto8 commented Dec 8, 2025

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.

@jkowalski jkowalski changed the title feat(snapshot): disable progress by default if no tty feat(cli): disable progress by default if no tty Dec 9, 2025
@jkowalski
Copy link
Contributor

this is a great idea

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.70%. Comparing base (cb455c6) to head (90a2caf).
⚠️ Report is 795 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jkowalski
Copy link
Contributor

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.
@presto8 presto8 force-pushed the no-progress-without-tty branch from 90a2caf to d227611 Compare December 9, 2025 14:07
Copilot AI review requested due to automatic review settings December 9, 2025 14:07
Copy link

Copilot AI left a 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.

@presto8
Copy link
Author

presto8 commented Dec 9, 2025

please fix the linter issues and we can merge it, LGTM

Thank you! Long time kopia user, first time contributor (and also first time to a Go project) :-) Fixed the lint issues, sorry about that!

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.

Kopia should not output binary characters when running non-interactively

2 participants