Documentation
¶
Overview ¶
Package terminal provides terminal-related utilities.
Index ¶
Constants ¶
View Source
const DefaultWidth = 50
DefaultWidth is the default terminal width when detection fails.
Variables ¶
View Source
var GetSize = term.GetSize
GetSize returns the terminal width and height for the given file descriptor. This is a variable to allow mocking in tests.
View Source
var IsTTY = isatty.IsTerminal
IsTTY checks if the file descriptor is a TTY. This is a variable to allow mocking in tests.
Functions ¶
func GetWidthFromWriter ¶
GetWidthFromWriter returns the terminal width for the given writer. Returns DefaultWidth if detection fails or writer is not a terminal.
func IsTerminalWriter ¶
IsTerminalWriter returns true if the given writer is a terminal.
Types ¶
Click to show internal directories.
Click to hide internal directories.