term

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTerminalHeight = 25

DefaultTerminalHeight is the default fallback terminal height.

View Source
const DefaultTerminalWidth = 80

DefaultTerminalWidth is the default fallback terminal width.

Variables

View Source
var FixedTerminalHeight = -1

FixedTerminalHeight allows a manual fixed override of the terminal height.

View Source
var FixedTerminalWidth = -1

FixedTerminalWidth allows a manual fixed override of the terminal width.

Functions

func GetTerminalSize

func GetTerminalSize() (int, int)

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 IsUnixGardenContainer

func IsUnixGardenContainer() bool

IsUnixGardenContainer is used for Unix-like system, returns whether the current process is started in the process tree of garden container (https://github.com/cloudfoundry/garden). IsUnixGardenContainer fixes the function github.com/gonvenience/term@v1.0.0#IsGardenContainer, which causes nil-pointer panic on windows, cause there is no process of pid 1.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL