term

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidState = errors.New("Invalid terminal state")
)

Functions

func DisableEcho

func DisableEcho(fd uintptr, state *State) error

func GetFdInfo added in v0.20.0

func GetFdInfo(in interface{}) (uintptr, bool)

func IsTerminal

func IsTerminal(fd uintptr) bool

IsTerminal returns true if the given file descriptor is a terminal.

func RestoreTerminal

func RestoreTerminal(fd uintptr, state *State) error

Restore restores the terminal connected to the given file descriptor to a previous state.

func SetWinsize

func SetWinsize(fd uintptr, ws *Winsize) error

func StdStreams added in v0.20.0

func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer)

Types

type State

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

func MakeRaw

func MakeRaw(fd uintptr) (*State, error)

MakeRaw put the terminal connected to the given file descriptor into raw mode and returns the previous state of the terminal so that it can be restored.

func SaveState

func SaveState(fd uintptr) (*State, error)

func SetRawTerminal

func SetRawTerminal(fd uintptr) (*State, error)

type Termios

type Termios syscall.Termios

type Winsize

type Winsize struct {
	Height uint16
	Width  uint16
	// contains filtered or unexported fields
}

func GetWinsize

func GetWinsize(fd uintptr) (*Winsize, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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