Documentation
¶
Index ¶
- Constants
- type Option
- type Terminal
- func (t *Terminal) Clear(opts ...cell.Option) error
- func (t *Terminal) Close()
- func (t *Terminal) DisableMouse()
- func (t *Terminal) EnableMouse()
- func (t *Terminal) EnableMouseMotion()
- func (t *Terminal) Event(ctx context.Context) terminalapi.Event
- func (t *Terminal) Flush() error
- func (t *Terminal) HideCursor()
- func (t *Terminal) MouseEnabled() bool
- func (t *Terminal) SetCell(p image.Point, r rune, opts ...cell.Option) error
- func (t *Terminal) SetCursor(p image.Point)
- func (t *Terminal) Size() image.Point
Constants ¶
const DefaultColorMode = terminalapi.ColorMode256
DefaultColorMode is the default value for the ColorMode option.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is used to provide options.
func ClearStyle ¶
ClearStyle sets the style to use for tcell when clearing the screen. Defaults to ColorDefault for foreground and background.
func ColorMode ¶
func ColorMode(cm terminalapi.ColorMode) Option
ColorMode sets the terminal color mode. Defaults to DefaultColorMode.
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal provides input and output to a real terminal. Wraps the gdamore/tcell terminal implementation. This object is not thread-safe. Implements terminalapi.Terminal.
func New ¶
New returns a new tcell based Terminal. Call Close() when the terminal isn't required anymore.
func (*Terminal) Close ¶
func (t *Terminal) Close()
Close closes the terminal, should be called when the terminal isn't required anymore to return the screen to a sane state. Implements terminalapi.Terminal.Close.
func (*Terminal) DisableMouse ¶ added in v0.21.0
func (t *Terminal) DisableMouse()
DisableMouse disables mouse capture so the host terminal can select text.
func (*Terminal) EnableMouse ¶ added in v0.21.0
func (t *Terminal) EnableMouse()
EnableMouse enables mouse capture for focus and click handling.
func (*Terminal) EnableMouseMotion ¶ added in v0.21.0
func (t *Terminal) EnableMouseMotion()
EnableMouseMotion enables mouse capture including click and drag events. Standalone hover motion isn't enabled because Termdash represents tcell's ButtonNone event as a release, which would prematurely cancel drag gestures.
func (*Terminal) Event ¶
func (t *Terminal) Event(ctx context.Context) terminalapi.Event
Event implements terminalapi.Terminal.Event.
func (*Terminal) HideCursor ¶
func (t *Terminal) HideCursor()
HideCursor implements terminalapi.Terminal.HideCursor.
func (*Terminal) MouseEnabled ¶ added in v0.21.0
MouseEnabled reports whether mouse capture is currently enabled.