Documentation
¶
Overview ¶
Package console detects output capabilities without writing escape sequences or reading terminal input. Font coverage cannot be queried portably, so font support is unknown unless explicitly configured by the user.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capabilities ¶
type Capabilities struct {
Terminal bool
ANSI bool
Unicode bool
Powerline Support
NerdFont Support
}
Capabilities describes one output destination, not process-wide state. Unicode and ANSI are conservative environment-based estimates, not probes. Powerline support alone does not imply support for Nerd Font icons.
func Detect ¶
func Detect(w io.Writer) Capabilities
Detect checks whether w is a terminal and inspects the current environment. Non-file writers, redirected files, and TERM=dumb use plain ASCII output. Unicode requires a UTF-8 locale (LC_ALL, LC_CTYPE, then LANG), or an explicitly enabled font. VIEWKIT_POWERLINE and VIEWKIT_NERD_FONT accept strconv.ParseBool values; unset, "auto", and invalid values mean unknown. Nerd Fonts include Powerline symbols, unless Powerline is explicitly disabled. Font overrides do not enable capabilities for non-terminal or dumb output. Detect neither changes global rendering state nor consumes terminal input.