Skip to content

TTY_INTERACTIVE env var #3777

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

Merged
merged 4 commits into from
Jun 23, 2025
Merged

TTY_INTERACTIVE env var #3777

merged 4 commits into from
Jun 23, 2025

Conversation

willmcgugan
Copy link
Member

@willmcgugan willmcgugan commented Jun 20, 2025

Adds a TTY_INTERACTIVE to disable things like progress bar / status spinners in CI

This adds to the new TTY_COMPATIBLE which enables styles even when the file is not technically a tty, as is the case in Github Actions. TTY_INTERACTIVE=0 will remove superfluous animations and progress bars in the CI output.

@codecov-commenter
Copy link

codecov-commenter commented Jun 20, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.85%. Comparing base (b96cd22) to head (b46bd78).
Report is 14 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3777   +/-   ##
=======================================
  Coverage   97.84%   97.85%           
=======================================
  Files          74       74           
  Lines        8136     8142    +6     
=======================================
+ Hits         7961     7967    +6     
  Misses        175      175           
Flag Coverage Δ
unittests 97.85% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@15r10nk
Copy link

15r10nk commented Jun 21, 2025

I assumed that this option had something to do with interactive terminals, where you can not read from stdin. But, If I understand you correct, you are still able to read user input, even when TTY_INTERACTIVE=0 is enabled.

Maybe call it TTY_ANIMATION=0

@willmcgugan
Copy link
Member Author

It echos an existing attribute in Rich. In that context interactive means somebody (i.e. a human) is interacting with the terminal, as apposed to running on CI. You are still able to read input, but reading from stdin doesn't always requires a human operator.

It does disable animation, but the flag in Rich has broader meaning.

It could also be RICH_INTERACTIVE. Perhaps the namespace would avoid any confusion?

@15r10nk
Copy link

15r10nk commented Jun 23, 2025

Naming things is hard. I think naming it RICH_INTERACTIVE is a good choice if it is not a environment variable which is also used by other projects with the same meaning.

@willmcgugan
Copy link
Member Author

Naming things is hard. I think naming it RICH_INTERACTIVE is a good choice if it is not a environment variable which is also used by other projects with the same meaning.

I'd actually like it to become a standard thing. AFAIK there is no standard var for that, and I'd like it to become one...

@willmcgugan willmcgugan merged commit 3b70db5 into master Jun 23, 2025
21 checks passed
@willmcgugan willmcgugan deleted the tty-interactive branch June 23, 2025 16:02
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