Documentation ¶
Overview ¶
Package tty provides methods for working with TTY
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHeight ¶
func GetHeight() int
GetHeight returns window height
Example ¶
height := GetHeight() if height == -1 { fmt.Println("Can't detect window size") return } fmt.Printf("Window height: %d\n", height)
Output:
func GetSize ¶
GetSize returns window width and height
Example ¶
width, height := GetSize() if width == -1 && height == -1 { fmt.Println("Can't detect window size") return } fmt.Printf("Window size: %d x %d\n", width, height)
Output:
func GetWidth ¶
func GetWidth() int
GetWidth returns window width
Example ¶
width := GetWidth() if width == -1 { fmt.Println("Can't detect window size") return } fmt.Printf("Window width: %d\n", width)
Output:
func IsSystemd ¶
func IsSystemd() bool
IsSystemd returns true if process started by systemd
Example ¶
if IsSystemd() { fmt.Println("This process started by systemd") }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.