Documentation
¶
Overview ¶
Package term provides terminal capability detection and ANSI color utilities. It uses golang.org/x/term for TTY detection and respects NO_COLOR, TERM=dumb, and COLORTERM environment variables.
Index ¶
Constants ¶
View Source
const ( ColorNone = 0 // No color support ColorBasic = 1 // Basic 16 colors Color256 = 2 // 256 colors ColorTrue = 3 // 24-bit true color )
ColorLevel indicates the terminal's color support.
View Source
const ( Reset = "\033[0m" Bold = "\033[1m" Dim = "\033[2m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" White = "\033[37m" Gray = "\033[90m" )
ANSI escape codes for basic colors.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Capability ¶
Capability holds detected terminal capabilities.
func Detect ¶
func Detect(fd int) Capability
Detect probes the given file descriptor for terminal capabilities.
Click to show internal directories.
Click to hide internal directories.