Documentation
¶
Overview ¶
Package term decides what the CLI may do with the user's terminal: is a stream a TTY, may it carry color, may we prompt. Every package asks here instead of calling isatty itself, so NO_COLOR, CLICOLOR=0 and --no-color are honored everywhere at once.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTerminal ¶
IsTerminal reports whether w is a terminal. Writers that aren't files (test buffers, captured output) are not.
func NoColor ¶
func NoColor() bool
NoColor reports whether color is switched off: --no-color, a non-empty NO_COLOR (https://no-color.org) or CLICOLOR=0.
func StderrIsTerminal ¶
func StderrIsTerminal() bool
StderrIsTerminal reports whether progress, spinners and hints meant for a person may be written to stderr.
func StdinIsTerminal ¶
func StdinIsTerminal() bool
StdinIsTerminal reports whether the CLI may prompt: stdin is a terminal.