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

Force color #2449

Merged
merged 8 commits into from
Aug 17, 2022
Merged
Prev Previous commit
Next Next commit
Add support for FORCE_COLOR environment variable
  • Loading branch information
darrenburns committed Aug 5, 2022
commit 264da3c3db06115fdb24986704af344c2dc3ba18
7 changes: 6 additions & 1 deletion rich/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,12 @@ def __init__(
self._height = height

self._color_system: Optional[ColorSystem]
self._force_terminal = force_terminal

if force_terminal is not None:
self._force_terminal = force_terminal
else:
self._force_terminal = self._environ.get("FORCE_COLOR") is not None

self._file = file
self.quiet = quiet
self.stderr = stderr
Expand Down