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

If FORCE_COLOR is set, tell rich to force_terminal #347

Closed

Conversation

AndydeCleyre
Copy link
Contributor

Another try for the case of #243, as an alternative to #345.

This uses rich's force_terminal option whenever FORCE_COLOR is set in the environment, and so applies to any CI system equally. The user is however required to go ahead and set FORCE_COLOR when they want it.

@codecov
Copy link

codecov bot commented Oct 7, 2022

Codecov Report

Base: 84.92% // Head: 84.92% // No change to project coverage 👍

Coverage data is based on head (88d09ed) compared to base (ce9464d).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #347   +/-   ##
=======================================
  Coverage   84.92%   84.92%           
=======================================
  Files          21       21           
  Lines        1844     1844           
  Branches      283      283           
=======================================
  Hits         1566     1566           
  Misses        236      236           
  Partials       42       42           
Impacted Files Coverage Δ
ward/_terminal.py 62.95% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@darrenburns
Copy link
Owner

Rich itself will check for FORCE_COLOR, and if it's set, it'll set force_terminal=True inside the Console constructor. Funnily enough, it was me that implemented this inside Rich 😄

Not 100% certain the best approach to take here though. I'd like Ward to "just work" without users having to know about this env var.

@AndydeCleyre
Copy link
Contributor Author

Oh!

Well I'll withdraw this PR for a start.

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.

None yet

2 participants