package term
import "github.com/ory/dockertest/v3/docker/pkg/term"
Index ¶
- Variables
- func DisableEcho(fd uintptr, state *State) error
- func GetFdInfo(in interface{}) (uintptr, bool)
- func IsTerminal(fd uintptr) bool
- func NewEscapeProxy(r io.Reader, escapeKeys []byte) io.Reader
- func RestoreTerminal(fd uintptr, state *State) error
- func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer)
- func ToBytes(keys string) ([]byte, error)
- type EscapeError
- type State
- func MakeRaw(fd uintptr) (*State, error)
- func SaveState(fd uintptr) (*State, error)
- func SetRawTerminal(fd uintptr) (*State, error)
- func SetRawTerminalOutput(fd uintptr) (*State, error)
- type Winsize
Variables ¶
var ASCII = []string{ "ctrl-@", "ctrl-a", "ctrl-b", "ctrl-c", "ctrl-d", "ctrl-e", "ctrl-f", "ctrl-g", "ctrl-h", "ctrl-i", "ctrl-j", "ctrl-k", "ctrl-l", "ctrl-m", "ctrl-n", "ctrl-o", "ctrl-p", "ctrl-q", "ctrl-r", "ctrl-s", "ctrl-t", "ctrl-u", "ctrl-v", "ctrl-w", "ctrl-x", "ctrl-y", "ctrl-z", "ctrl-[", "ctrl-\\", "ctrl-]", "ctrl-^", "ctrl-_", }
ASCII list the possible supported ASCII key sequence
Functions ¶
func DisableEcho ¶
DisableEcho disables echo for the terminal connected to the given file descriptor. -- See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx
func GetFdInfo ¶
GetFdInfo returns the file descriptor for an os.File and indicates whether the file represents a terminal.
func IsTerminal ¶
IsTerminal returns true if the given file descriptor is a terminal.
func NewEscapeProxy ¶
NewEscapeProxy returns a new TTY proxy reader which wraps the given reader and detects when the specified escape keys are read, in which case the Read method will return an error of type EscapeError.
func RestoreTerminal ¶
RestoreTerminal restores the terminal connected to the given file descriptor to a previous state.
func StdStreams ¶
func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer)
StdStreams returns the standard streams (stdin, stdout, stderr).
func ToBytes ¶
ToBytes converts a string representing a suite of key-sequence to the corresponding ASCII code.
Types ¶
type EscapeError ¶
type EscapeError struct{}
EscapeError is special error which returned by a TTY proxy reader's Read() method in case its detach escape sequence is read.
func (EscapeError) Error ¶
func (EscapeError) Error() string
type State ¶
type State struct {
// contains filtered or unexported fields
}
State holds the console mode for the terminal.
func MakeRaw ¶
MakeRaw puts the terminal (Windows Console) connected to the given file descriptor into raw mode and returns the previous state of the terminal so that it can be restored.
func SaveState ¶
SaveState saves the state of the terminal connected to the given file descriptor.
func SetRawTerminal ¶
SetRawTerminal puts the terminal connected to the given file descriptor into raw mode and returns the previous state. On UNIX, this puts both the input and output into raw mode. On Windows, it only puts the input into raw mode.
func SetRawTerminalOutput ¶
SetRawTerminalOutput puts the output of terminal connected to the given file descriptor into raw mode. On UNIX, this does nothing and returns nil for the state. On Windows, it disables LF -> CRLF translation.
type Winsize ¶
Winsize is used for window size.
func GetWinsize ¶
GetWinsize returns the window size based on the specified file descriptor.
Source Files ¶
ascii.go proxy.go term_windows.go
Directories ¶
Path | Synopsis |
---|---|
docker/pkg/term/windows |
- Version
- v3.6.0
- Published
- Apr 10, 2020
- Platform
- windows/amd64
- Imports
- 8 packages
- Last checked
- 1 hour ago –
Tools for package owners.