termios

package
v0.0.0-...-ba2a951 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTermios

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

GetTermios gets the termios of the given fd.

func GetWinSize

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

GetWinSize gets window size for an fd.

func SetTermios

func SetTermios(
	fd int,
	ispeed uint32,
	ospeed uint32,
	cc map[CC]uint8,
	iflag map[I]bool,
	oflag map[O]bool,
	cflag map[C]bool,
	lflag map[L]bool,
) error

SetTermios sets the given termios over the given fd's current termios.

func SetWinSize

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

SetWinSize sets window size for an fd from a Winsize.

Types

type C

type C uint8

Control

const (
	CS7 C = iota
	CS8
	PARENB
	PARODD
)

Control possible values.

type CC

type CC uint8

CC is the termios cc field.

It stores an array of special characters related to terminal I/O.

const (
	INTR CC = iota
	QUIT
	ERASE
	KILL
	EOF
	EOL
	EOL2
	START
	STOP
	SUSP
	WERASE
	RPRNT
	LNEXT
	DISCARD
	STATUS
	SWTCH
	DSUSP
	FLUSH
)

CC possible values.

type I

type I uint8

Input Controls

const (
	IGNPAR I = iota
	PARMRK
	INPCK
	ISTRIP
	INLCR
	IGNCR
	ICRNL
	IXON
	IXANY
	IXOFF
	IMAXBEL
	IUCLC
)

Input possible values.

type L

type L uint8

Line Controls.

const (
	ISIG L = iota
	ICANON
	ECHO
	ECHOE
	ECHOK
	ECHONL
	NOFLSH
	TOSTOP
	IEXTEN
	ECHOCTL
	ECHOKE
	PENDIN
	IUTF8
	XCASE
)

Line possible values.

type O

type O uint8

Output Controls

const (
	OPOST O = iota
	ONLCR
	OCRNL
	ONOCR
	ONLRET
	OLCUC
)

Output possible values.

Jump to

Keyboard shortcuts

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