Documentation ¶
Overview ¶
Package termios implements basic termios operations including getting a tty struct, termio struct, a winsize struct, and setting raw mode. To get a TTY, call termios.New. To get a Termios, call tty.Get(); to set it, call tty.Set(*Termios) To set raw mode and then restore, one can do: tty := termios.NewTTY() restorer, err := tty.Raw() do things tty.Set(restorer)
Index ¶
- Constants
- func GTTY(fd int) (*tty, error)
- func GetTermios(fd uintptr) (*unix.Termios, error)
- func GetWinSize(fd uintptr) (*unix.Winsize, error)
- func MakeRaw(term *unix.Termios) *unix.Termios
- func Raw(fd int) (*tty, error)
- func SetTermios(fd uintptr, ti *unix.Termios) error
- func SetWinSize(fd uintptr, w *unix.Winsize) error
- type TTY
- func (t *TTY) Get() (*unix.Termios, error)
- func (t *TTY) GetWinSize() (*unix.Winsize, error)
- func (t *TTY) Raw() (*unix.Termios, error)
- func (t *TTY) Read(b []byte) (int, error)
- func (t *TTY) Set(ti *unix.Termios) error
- func (t *TTY) SetWinSize(w *unix.Winsize) error
- func (t *TTY) Write(b []byte) (int, error)
Constants ¶
View Source
const ( I = iota // Input control O // Output control C // Control L // Line control )
These consts describe the offsets into the termios struct of various elements.
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.