ptyutil

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSize

func GetSize(fd int) (int, int, error)

GetSize returns the dimensions of the given terminal.

func IsTerminal

func IsTerminal(fd int) bool

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

func OpenPty

func OpenPty(uid, gid int64) (*os.File, *os.File, error)

OpenPty creates a new PTS pair, configures them and returns them.

func OpenPtyInDevpts

func OpenPtyInDevpts(devpts_fd int, uid, gid int64) (*os.File, *os.File, error)

OpenPtyInDevpts creates a new PTS pair, configures them and returns them.

func Restore

func Restore(fd int, state *State) error

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

func SetSize

func SetSize(fd int, width int, height int) (err error)

SetSize sets the dimensions of the terminal associated with fd.

Types

type State

type State struct {
	Termios unix.Termios
}

State contains the state of a terminal.

func GetState

func GetState(fd int) (*State, error)

GetState returns the current state of a terminal which may be useful to restore the terminal after a signal.

func MakeRaw

func MakeRaw(fd int) (*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.

Jump to

Keyboard shortcuts

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