Skip to main content

Module terminal

Module terminal 

Source
Expand description

Terminal capability detection and color policy.

These helpers decide whether a stream should receive ANSI styling or interactive behavior (progress lines, prompts). They do not decide what to print — see crate::color for that.

Enums§

ColorMode
Explicit color policy a CLI can expose through a --color flag.

Functions§

is_stderr_terminal
Whether stderr is attached to an interactive terminal.
is_stdin_terminal
Whether stdin is attached to an interactive terminal.
is_stdout_terminal
Whether stdout is attached to an interactive terminal.
resolve_color
Resolve whether color should be enabled for a stream, given an explicit ColorMode policy and whether that stream is a TTY.
stderr_supports_color
Whether stderr output should be colorized under the Auto policy: a TTY and no NO_COLOR override.
stdout_supports_color
Whether stdout output should be colorized under the Auto policy: a TTY and no NO_COLOR override.