{"modulePath":"github.com/hyperhq/hypercli","version":"v1.10.16","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package term\n\nPackage term provides provides structures and helper functions to work with terminal (state, sizes).\n\n## Variables\n\n```go\nvar ASCII = []string{\n\t\"ctrl-@\",\n\t\"ctrl-a\",\n\t\"ctrl-b\",\n\t\"ctrl-c\",\n\t\"ctrl-d\",\n\t\"ctrl-e\",\n\t\"ctrl-f\",\n\t\"ctrl-g\",\n\t\"ctrl-h\",\n\t\"ctrl-i\",\n\t\"ctrl-j\",\n\t\"ctrl-k\",\n\t\"ctrl-l\",\n\t\"ctrl-m\",\n\t\"ctrl-n\",\n\t\"ctrl-o\",\n\t\"ctrl-p\",\n\t\"ctrl-q\",\n\t\"ctrl-r\",\n\t\"ctrl-s\",\n\t\"ctrl-t\",\n\t\"ctrl-u\",\n\t\"ctrl-v\",\n\t\"ctrl-w\",\n\t\"ctrl-x\",\n\t\"ctrl-y\",\n\t\"ctrl-z\",\n\t\"ctrl-[\",\n\t\"ctrl-\\\\\",\n\t\"ctrl-]\",\n\t\"ctrl-^\",\n\t\"ctrl-_\",\n}\n```\nASCII list the possible supported ASCII key sequence\n\n```go\nvar (\n\t// ErrInvalidState is returned if the state of the terminal is invalid.\n\tErrInvalidState = errors.New(\"Invalid terminal state\")\n)\n```\n\n## Functions\n\n```go\nfunc DisableEcho(fd uintptr, state *State) error\n```\nDisableEcho applies the specified state to the terminal connected to the file descriptor, with echo disabled.\n\n```go\nfunc GetFdInfo(in interface{}) (uintptr, bool)\n```\nGetFdInfo returns the file descriptor for an os.File and indicates whether the file represents a terminal.\n\n```go\nfunc IsTerminal(fd uintptr) bool\n```\nIsTerminal returns true if the given file descriptor is a terminal.\n\n```go\nfunc RestoreTerminal(fd uintptr, state *State) error\n```\nRestoreTerminal restores the terminal connected to the given file descriptor to a previous state.\n\n```go\nfunc SetWinsize(fd uintptr, ws *Winsize) error\n```\nSetWinsize tries to set the specified window size for the specified file descriptor.\n\n```go\nfunc StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer)\n```\nStdStreams returns the standard streams (stdin, stdout, stedrr).\n\n```go\nfunc ToBytes(keys string) ([]byte, error)\n```\nToBytes converts a string representing a suite of key-sequence to the corresponding ASCII code.\n\n## Types\n\n```go\ntype State struct {\n\t// contains filtered or unexported fields\n}\n```\nState represents the state of the terminal.\n\n```go\nfunc MakeRaw(fd uintptr) (*State, error)\n```\nMakeRaw 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.\n\n```go\nfunc SaveState(fd uintptr) (*State, error)\n```\nSaveState saves the state of the terminal connected to the given file descriptor.\n\n```go\nfunc SetRawTerminal(fd uintptr) (*State, error)\n```\nSetRawTerminal puts the terminal connected to the given file descriptor into raw mode and returns the previous state.\n\n```go\ntype Termios syscall.Termios\n```\nTermios is the Unix API for terminal I/O. It is passthgrouh for syscall.Termios in order to make it portable with other platforms where it is not available or handled differently.\n\n```go\ntype Winsize struct {\n\tHeight uint16\n\tWidth  uint16\n\t// contains filtered or unexported fields\n}\n```\nWinsize represents the size of the terminal window.\n\n```go\nfunc GetWinsize(fd uintptr) (*Winsize, error)\n```\nGetWinsize returns the window size based on the specified file descriptor.\n\n","path":"github.com/hyperhq/hypercli/pkg/term","name":"term","synopsis":"Package term provides provides structures and helper functions to work with terminal (state, sizes).","isRedistributable":true}
