modulepackage
0.0.0-20230512153006-5935fcd4d5e9
Repository: https://github.com/quackduck/term.git
Documentation: pkg.go.dev
# README
Go terminal/console support
This repository provides Go terminal and console support packages.
Download/Install
The easiest way to install is to run go get -u golang.org/x/term
. You can
also manually git clone the repository to $GOPATH/src/golang.org/x/term
.
Report Issues / Send Patches
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the term repository is located at https://github.com/golang/go/issues. Prefix your issue with "x/term:" in the subject line, so it is easy to find.
# Functions
GetSize returns the visible dimensions of the given terminal.
GetState returns the current state of a terminal which may be useful to restore the terminal after a signal.
IsTerminal returns whether the given file descriptor is a terminal.
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.
NewTerminal runs a VT100 terminal on the given ReadWriter.
ReadPassword reads a line of input from a terminal without local echo.
Restore restores the terminal connected to the given file descriptor to a previous state.
# Variables
ErrPasteIndicator may be returned from ReadLine as the error, in addition to valid line data.
# Structs
EscapeCodes contains escape sequences that can be written to the terminal in order to achieve different styles of text.
State contains the state of a terminal.
Terminal contains the state for running a VT100 terminal that is capable of reading lines of input.