Skip to main content

Module env

Module env 

Source
Expand description

Runtime detection of whether ANSI color output should be enabled.

Respects the NO_COLOR and FORCE_COLOR environment variable conventions, in that order of precedence, before falling back to TTY detection.

The result is computed once per process and cached in a OnceLock.

Functionsยง

color_enabled
Returns whether ANSI color output is enabled for this process.