Documentation
¶
Overview ¶
Package tty provides terminal detection and colour helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Colourise ¶
Colourise wraps text in the given ANSI escape code when colour is enabled, and returns the plain text otherwise. code should be an SGR parameter string such as "92" (bright green) or "91" (bright red).
func IsColourEnabled ¶
func IsColourEnabled() bool
IsColourEnabled reports whether ANSI colour output should be produced.
Colour is disabled when any of the following conditions is true:
- The NO_COLOR environment variable is non-empty (https://no-color.org)
- The TERM environment variable is "dumb"
- stdout is not a character device (i.e. it is a pipe or regular file)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.