go1.20.5
GoThrough

terminal.ErrPasteIndicator

// ErrPasteIndicator may be returned from ReadLine as the error, in addition // to valid line data. It indicates that bracketed paste mode is enabled and // that the returned line consists only of pasted data. Programs may wish to // interpret pasted data more literally than typed data. var ErrPasteIndicator = term.ErrPasteIndicator

terminal.GetSize

// GetSize returns the dimensions of the given terminal. func GetSize(fd int) (width int, height int, err error)

terminal.GetState

// GetState returns the current state of a terminal which may be useful to // restore the terminal after a signal. func GetState(fd int) (*State, error)

terminal.IsTerminal

// IsTerminal returns whether the given file descriptor is a terminal. func IsTerminal(fd int) bool

terminal.MakeRaw

// MakeRaw puts 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 MakeRaw(fd int) (*State, error)

terminal.NewTerminal

// NewTerminal runs a VT100 terminal on the given ReadWriter. If the ReadWriter is // a local terminal, that terminal must first have been put into raw mode. // prompt is a string that is written at the start of each input line (i.e. // "> "). func NewTerminal(c io.ReadWriter, prompt string) *Terminal

terminal.ReadPassword

// ReadPassword reads a line of input from a terminal without local echo. This // is commonly used for inputting passwords and other sensitive data. The slice // returned does not include the \n. func ReadPassword(fd int) ([]byte, error)

terminal.Restore

// Restore restores the terminal connected to the given file descriptor to a // previous state. func Restore(fd int, oldState *State) error