Skip to content
Myr

🐛 Fix setting `FORCE_TERMINAL` with colors (#423)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sebastián Ramírez · committed by GitHub · parent b0c2647 · Browse files · 1 file+10 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−5 removed

  • other:+10 added−5 removed

1 file+10 added−5 removed

modified:typer/rich_utils.py+10 added-5 removed
69 unmodified lines
70COLOR_SYSTEM: Optional[71 Literal["auto", "standard", "256", "truecolor", "windows"]72] = "auto" # Set to None to disable colors73_TYPER_FORCE_DISABLE_TERMINAL = getenv("_TYPER_FORCE_DISABLE_TERMINAL")74FORCE_TERMINAL = bool(75 not _TYPER_FORCE_DISABLE_TERMINAL76 and getenv("GITHUB_ACTIONS")77 or getenv("FORCE_COLOR")78 or getenv("PY_COLORS")74FORCE_TERMINAL = (75 True76 if getenv("GITHUB_ACTIONS") or getenv("FORCE_COLOR") or getenv("PY_COLORS")77 else None78)79if _TYPER_FORCE_DISABLE_TERMINAL:80 FORCE_TERMINAL = False8182print(FORCE_TERMINAL)8384print(FORCE_TERMINAL)8586# Fixed strings87DEPRECATED_STRING = "(deprecated) "88DEFAULT_STRING = "[default: {}]"89ENVVAR_STRING = "[env var: {}]"
609 unmodified lines