Skip to main content

should_use_ansi

Function should_use_ansi 

Source
pub fn should_use_ansi() -> bool
Expand description

Returns whether ANSI escape codes should be emitted to stderr.

Precedence:

  1. NO_COLOR set (any value) → false (https://no-color.org standard)
  2. CLICOLOR_FORCE=1 → true (force colors even without TTY)
  3. stderr is a terminal → true
  4. fallback → false