Documentation
¶
Overview ¶
Package term contains convenience functions for terminal related tasks, for example to get the current terminal width or a reasonable fallback.
Index ¶
Constants ¶
const DefaultTerminalHeight = 25
DefaultTerminalHeight is the default fallback terminal height.
const DefaultTerminalWidth = 80
DefaultTerminalWidth is the default fallback terminal width.
Variables ¶
var FixedTerminalHeight = -1
FixedTerminalHeight allows a manual fixed override of the terminal height.
var FixedTerminalWidth = -1
FixedTerminalWidth allows a manual fixed override of the terminal width.
Functions ¶
func GetTerminalHeight ¶
func GetTerminalHeight() int
GetTerminalHeight return the terminal height (available lines).
func GetTerminalSize ¶
GetTerminalSize return the terminal size as a width and height tuple. In case the terminal size cannot be determined, a reasonable default is used: 80x25. A manual override is possible using FixedTerminalWidth and FixedTerminalHeight.
func GetTerminalWidth ¶
func GetTerminalWidth() int
GetTerminalWidth return the terminal width (available characters per line)
func IsDumbTerminal ¶
func IsDumbTerminal() bool
IsDumbTerminal returns whether the current terminal has a limited feature set
func IsGardenContainer ¶
func IsGardenContainer() bool
IsGardenContainer returns whether the current process is started in the process tree of garden container (https://github.com/cloudfoundry/garden).
func IsTerminal ¶
func IsTerminal() bool
IsTerminal returns whether this program runs in a terminal and not in a pipe
func IsTrueColor ¶
func IsTrueColor() bool
IsTrueColor returns whether the current terminal supports 24 bit colors
Types ¶
This section is empty.