Documentation
¶
Overview ¶
Package terminal provides TTY detection, dimension validation, color capability detection, and tmux awareness.
Index ¶
Constants ¶
View Source
const MinHeight = 24
MinHeight is the minimum terminal height required.
View Source
const MinWidth = 80
MinWidth is the minimum terminal width required.
Variables ¶
This section is empty.
Functions ¶
func CheckDimensions ¶
CheckDimensions returns an error if the terminal is smaller than 80x24.
Types ¶
type ColorProfile ¶
type ColorProfile int
ColorProfile describes the terminal's color capability.
const ( ColorNone ColorProfile = iota // NO_COLOR or dumb terminal ColorBasic // 16-color ANSI ColorANSI256 // 256-color ColorTrueColor // 24-bit true color )
func DetectColorProfile ¶
func DetectColorProfile(env Env) ColorProfile
DetectColorProfile determines the terminal's color capability. Per https://no-color.org/, NO_COLOR set to any value (including empty) disables color output.
func (ColorProfile) String ¶
func (c ColorProfile) String() string
String returns a human-readable name for the color profile.
Click to show internal directories.
Click to hide internal directories.