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§
- Color
Mode - Explicit color policy a CLI can expose through a
--colorflag.
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
ColorModepolicy and whether that stream is a TTY. - stderr_
supports_ color - Whether stderr output should be colorized under the
Autopolicy: a TTY and noNO_COLORoverride. - stdout_
supports_ color - Whether stdout output should be colorized under the
Autopolicy: a TTY and noNO_COLORoverride.