termios

package
v0.0.0-...-8997438 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: BSD-3-Clause Imports: 2 Imported by: 0

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

This section is empty.

Variables

This section is empty.

Functions

func GetTermios

func GetTermios(fd uintptr) (*unix.Termios, error)

func GetWinSize

func GetWinSize(fd uintptr) (*unix.Winsize, error)

func MakeRaw

func MakeRaw(term *unix.Termios) *unix.Termios

func SetTermios

func SetTermios(fd uintptr, ti *unix.Termios) error

func SetWinSize

func SetWinSize(fd uintptr, w *unix.Winsize) error

Types

type TTY

type TTY struct {
	// contains filtered or unexported fields
}

func New

func New() (*TTY, error)

func (*TTY) Get

func (t *TTY) Get() (*unix.Termios, error)

func (*TTY) GetWinSize

func (t *TTY) GetWinSize() (*unix.Winsize, error)

func (*TTY) Raw

func (t *TTY) Raw() (*unix.Termios, error)

func (*TTY) Set

func (t *TTY) Set(ti *unix.Termios) error

func (*TTY) SetWinSize

func (t *TTY) SetWinSize(w *unix.Winsize) error

Jump to

Keyboard shortcuts

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