Documentation ¶
Overview ¶
Copyright 2021 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type ResizeEvent
- type StopEvent
- type Terminal
- func (t *Terminal) Clear() error
- func (t *Terminal) Close() error
- func (t *Terminal) InitRaw(input bool) error
- func (t *Terminal) IsAttached() bool
- func (t *Terminal) Resize(width, height int16) error
- func (t *Terminal) Size() (width int16, height int16, err error)
- func (t *Terminal) Stderr() io.Writer
- func (t *Terminal) Stdin() io.Reader
- func (t *Terminal) Stdout() io.Writer
- func (e *Terminal) Subscribe() chan interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResizeEvent ¶
type ResizeEvent struct{}
ResizeEvent is emitted when a terminal window is resized.
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal is used to configure raw input and output modes for an attached terminal emulator.
func New ¶
New creates a new Terminal instance. Callers should call `InitRaw` to configure the terminal for raw input or output modes.
Note that the returned Terminal instance must be closed to ensure the terminal is properly reset; unexpected exits may leave users' terminals unusable.
func (*Terminal) InitRaw ¶
InitRaw puts the terminal into raw mode. On Unix, no special input handling is required beyond simply reading from stdin, so `input` has no effect. Note that some implementations may replace one or more streams (particularly stdin).
func (*Terminal) IsAttached ¶
IsAttached determines if this terminal is attached to an interactive console session.
func (*Terminal) Resize ¶
Resize makes a best-effort attempt to resize the terminal window. Support varies between platforms and terminal emulators.