terminal#
Utility functions for terminal output.
Functions#
|
Return True if stdout is connected to a TTY. |
|
Return True when |
|
Return True when color output should be suppressed. |
|
Return True when color output should be forced even in non-TTY contexts. |
|
Determine whether ANSI color output should be produced. |
- term_dumb() bool#
Return True when
TERMindicates a non-capable terminal.TERM=dumbis the widely-followed terminfo convention for terminals that cannot render any ANSI escape sequences (color, bold, animations).TERM=unknownis treated the same way as a defensive fallback.
- no_color() bool#
Return True when color output should be suppressed.
Respects the
NO_COLORstandard (https://no-color.org/): color is suppressed when theNO_COLORenvironment variable is set to any value. Non-color ANSI formatting (bold, underline, etc.) may still be used.