tcellterm

package
v0.1.107 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: MIT, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type C0

type C0 rune

A C0 control code

func (C0) String

func (seq C0) String() string

type CSI

type CSI struct {
	Final        rune
	Intermediate []rune
	Parameters   []int
}

A CSI Sequence

func (CSI) String

func (seq CSI) String() string

type DCS

type DCS struct {
	Final        rune
	Intermediate []rune
	Parameters   []int
}

Sent at the beginning of a DCS passthrough sequence.

type DCSData

type DCSData rune

A rune which is passed through during a DCS passthrough sequence

type DCSEndOfData

type DCSEndOfData struct{}

Sent at the end of a DCS passthrough sequence

type EOF

type EOF struct{}

Sent when the underlying PTY is closed

func (EOF) String

func (seq EOF) String() string

type ESC

type ESC struct {
	Final        rune
	Intermediate []rune
}

An escape sequence with intermediate characters

func (ESC) String

func (seq ESC) String() string

type EventBell

type EventBell struct {
	*EventTerminal
}

EventBell is emitted when BEL is received

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

func (OSC) String

func (seq OSC) String() string

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 NewParser

func NewParser(r io.Reader) *Parser

func (*Parser) Next

func (p *Parser) Next() Sequence

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 Print

type Print rune

A character which should be printed to the screen

func (Print) String

func (seq Print) String() string

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 New

func New() *VT

func (*VT) Attach

func (vt *VT) Attach(fn func(ev tcell.Event))

func (*VT) Clear

func (vt *VT) Clear()

func (*VT) ClearSelection added in v0.1.47

func (vt *VT) ClearSelection()

func (*VT) Close

func (vt *VT) Close()

func (*VT) Copy

func (vt *VT) Copy() string

func (*VT) Cursor

func (vt *VT) Cursor() (int, int, tcell.CursorStyle, bool)

row, col, style, vis

func (*VT) Detach

func (vt *VT) Detach()

func (*VT) Draw

func (vt *VT) Draw()

func (*VT) HandleEvent

func (vt *VT) HandleEvent(e tcell.Event) bool

func (*VT) HasSelection added in v0.1.47

func (vt *VT) HasSelection() bool

func (*VT) IsScrolling

func (vt *VT) IsScrolling() bool

func (*VT) Resize

func (vt *VT) Resize(w int, h int)

func (*VT) ScrollDown

func (vt *VT) ScrollDown(offset int)

func (*VT) ScrollReset

func (vt *VT) ScrollReset()

func (*VT) ScrollUp

func (vt *VT) ScrollUp(offset int)

func (*VT) Scrollable

func (vt *VT) Scrollable() bool

func (*VT) SelectEnd

func (vt *VT) SelectEnd(x int, y int)

func (*VT) SelectStart

func (vt *VT) SelectStart(x int, y int)

func (*VT) SetSurface

func (vt *VT) SetSurface(srf Surface)

func (*VT) Start

func (vt *VT) Start(cmd *exec.Cmd) error

Start starts the terminal with the specified command. Start returns when the command has been successfully started.

func (*VT) String

func (vt *VT) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL