Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type In ¶
type In struct {
// contains filtered or unexported fields
}
In is an input stream to read user input. It implements io.ReadCloser with additional utilities, such as putting the terminal in raw mode.
func (*In) CheckTty ¶
CheckTty checks if we are trying to attach to a container TTY from a non-TTY client input stream, and if so, returns an error.
func (*In) IsTerminal ¶
func (s *In) IsTerminal() bool
IsTerminal returns true if this stream is connected to a terminal.
func (*In) RestoreTerminal ¶
func (s *In) RestoreTerminal()
RestoreTerminal restores normal mode to the terminal.
func (*In) SetIsTerminal ¶
func (s *In) SetIsTerminal(isTerminal bool)
SetIsTerminal overrides whether a terminal is connected. It is used to override this property in unit-tests, and should not be depended on for other purposes.
func (*In) SetRawTerminal ¶
SetRawTerminal sets raw mode on the input terminal. It is a no-op if In is not a TTY, or if the "NORAW" environment variable is set to a non-empty value.
type Out ¶
type Out struct {
// contains filtered or unexported fields
}
Out is an output stream to write normal program output. It implements an io.Writer, with additional utilities for detecting whether a terminal is connected, getting the TTY size, and putting the terminal in raw mode.
func (*Out) GetTtySize ¶
GetTtySize returns the height and width in characters of the TTY, or zero for both if no TTY is connected.
func (*Out) IsTerminal ¶
func (s *Out) IsTerminal() bool
IsTerminal returns true if this stream is connected to a terminal.
func (*Out) RestoreTerminal ¶
func (s *Out) RestoreTerminal()
RestoreTerminal restores normal mode to the terminal.
func (*Out) SetIsTerminal ¶
func (s *Out) SetIsTerminal(isTerminal bool)
SetIsTerminal overrides whether a terminal is connected. It is used to override this property in unit-tests, and should not be depended on for other purposes.
func (*Out) SetRawTerminal ¶
SetRawTerminal puts the output of the terminal connected to the stream into raw mode.
On UNIX, this does nothing. On Windows, it disables LF -> CRLF/ translation. It is a no-op if Out is not a TTY, or if the "NORAW" environment variable is set to a non-empty value.