term

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package term provides structures and helper functions to work with terminal (state, sizes).

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidState is returned if the state of the terminal is invalid.
	ErrInvalidState = errors.New("Invalid terminal state")
)

Functions

func DisableEcho

func DisableEcho(fd uintptr, state *State) error

DisableEcho applies the specified state to the terminal connected to the file descriptor, with echo disabled.

func RestoreTerminal

func RestoreTerminal(fd uintptr, state *State) error

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

Types

type State

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

State represents the state of the terminal.

func SaveState

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

SaveState saves the state of the terminal connected to the given file descriptor.

type Termios

type Termios unix.Termios

Termios is the Unix API for terminal I/O.

Jump to

Keyboard shortcuts

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