Documentation ¶
Index ¶
- type C0
- type CSI
- type DCS
- type DCSData
- type DCSEndOfData
- type EOF
- type ESC
- type EventBell
- type EventClosed
- type EventMouseMode
- type EventPanic
- type EventRedraw
- type EventTerminal
- type EventTitle
- type OSC
- type Parser
- type Print
- type Sequence
- type Surface
- type VT
- func (vt *VT) Attach(fn func(ev tcell.Event))
- func (vt *VT) Clear()
- func (vt *VT) ClearSelection()
- func (vt *VT) Close()
- func (vt *VT) Copy() string
- func (vt *VT) Cursor() (int, int, tcell.CursorStyle, bool)
- func (vt *VT) Detach()
- func (vt *VT) Draw()
- func (vt *VT) HandleEvent(e tcell.Event) bool
- func (vt *VT) HasSelection() bool
- func (vt *VT) IsScrolling() bool
- func (vt *VT) Resize(w int, h int)
- func (vt *VT) ScrollDown(offset int)
- func (vt *VT) ScrollReset()
- func (vt *VT) ScrollUp(offset int)
- func (vt *VT) Scrollable() bool
- func (vt *VT) SelectEnd(x int, y int)
- func (vt *VT) SelectStart(x int, y int)
- func (vt *VT) SetSurface(srf Surface)
- func (vt *VT) Start(cmd *exec.Cmd) error
- func (vt *VT) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventClosed ¶
type EventClosed struct {
*EventTerminal
}
EventClosed is emitted when the terminal exits
type EventMouseMode ¶
type EventMouseMode struct { *EventTerminal // contains filtered or unexported fields }
EventMouseMode is emitted when the terminal mouse mode changes
func (*EventMouseMode) Flags ¶
func (ev *EventMouseMode) Flags() []tcell.MouseFlags
type EventPanic ¶
type EventPanic struct { *EventTerminal Error error }
type EventRedraw ¶
type EventRedraw struct {
*EventTerminal
}
EventRedraw is emitted when the terminal requires redrawing
type EventTerminal ¶
type EventTerminal struct {
// contains filtered or unexported fields
}
EventTerminal is a generic terminal event
func (*EventTerminal) VT ¶
func (ev *EventTerminal) VT() *VT
func (*EventTerminal) When ¶
func (ev *EventTerminal) When() time.Time
type EventTitle ¶
type EventTitle struct { *EventTerminal // contains filtered or unexported fields }
EventTitle is emitted when the terminal's title changes
func (*EventTitle) Title ¶
func (ev *EventTitle) Title() string
type OSC ¶
type OSC struct {
Payload []rune
}
An OSC sequence. The Payload is the raw runes received, and must be parsed externally
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
https://vt100.net/emu/dec_ansi_parser
parser is an implementation of Paul Flo Williams' VT500-series parser, as seen [here](https://vt100.net/emu/dec_ansi_parser). The architecture is designed after Rob Pike's text/template parser, with a few modifications.
Many of the comments are directly from Paul Flo Williams description of the parser, licensed undo [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/)
func (*Parser) Next ¶
Next returns the next Sequence. Sequences will be of the following types:
error Sent on any parsing error Print Print the character to the screen C0 Execute the C0 code ESC Execute the ESC sequence CSI Execute the CSI sequence OSCStart Signals the start of an OSC sequence OSCData Characters from the OSC sequence OSCEnd Signals end of the OSC sequence DCS Signals start of a DCS sequence, and DCS params/intermediates DCSData Raw DCS passthrough data DCSEndOfData Signals end of DCS sequence EOF Sent at end of input
type Sequence ¶
type Sequence interface{}
Sequence is the generic data type of items emitted from the parser. These can be control sequences, escape sequences, or printable characters.
type Surface ¶
type Surface interface { // SetContent is used to update the content of the Surface at the given // location. SetContent(x int, y int, ch rune, comb []rune, style tcell.Style) // Size represents the visible size. Size() (int, int) }
Surface represents a logical view on an area. It uses a subset of methods from a tcell.Screen or a views.View, in order to be a more broad implementation. Both a Screen and a View are also a Surface
type VT ¶
type VT struct { Logger *log.Logger // If true, OSC8 enables the output of OSC8 strings. Otherwise, any OSC8 // sequences will be stripped OSC8 bool // Set the TERM environment variable to be passed to the command's // environment. If not set, xterm-256color will be used TERM string // contains filtered or unexported fields }
VT models a virtual terminal
func (*VT) ClearSelection ¶ added in v0.1.47
func (vt *VT) ClearSelection()
func (*VT) HandleEvent ¶
func (*VT) HasSelection ¶ added in v0.1.47
func (*VT) IsScrolling ¶
func (*VT) ScrollDown ¶
func (*VT) ScrollReset ¶
func (vt *VT) ScrollReset()