cog
85c9b9af - fix: auto-detect color support from environment and TTY

Commit
147 days ago
fix: auto-detect color support from environment and TTY Disable color output automatically when the environment indicates it is not appropriate. Previously, Console.Color was hardcoded to true regardless of context. Color is now disabled when any of the following are true: - NO_COLOR env var is set (per https://no-color.org/) - COG_NO_COLOR env var is set - TERM=dumb - stderr is not an interactive terminal (TTY) The TTY check is on stderr specifically, since that is where cog writes all its colored log output. Refs: https://clig.dev/#output, https://no-color.org/
Author
Committer
Parents
Loading