Documentation ¶
Overview ¶
Package terminal provides an idiomatic Go interface for reading, writing, and restoring terminal capabilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal models a virtual terminal's current and former capabilities, so they can be easily altered and restored.
func New ¶
New returns a Terminal for the given file descriptor, capable of restoring that terminal to its current state.
func (Terminal) Bounds ¶
Bounds returns the terminal dimensions as an "image".Rectangle, suitable for constructing a virtual display.
func (*Terminal) Restore ¶
Restore resets the terminal capabilities to their original values, at time of construction.
func (Terminal) SetNoEcho ¶
SetNoEcho suppresses input to output echoing, so printable characters typed into the terminal are not implicitly written back out.
func (Terminal) SetRaw ¶
SetRaw makes a terminal suitable for full-screen terminal user interfaces, eliminating keyboard shortcuts for job control, echo, line buffering, and escape key debouncing.