Documentation ¶
Overview ¶
Package vterm provides a layer of abstraction between a channel of incoming text (possibly containing ANSI escape codes, et al) and a channel of outbound Char's.
A Char is a character printed using a given cursor (which is stored alongside the Char).
Index ¶
- Constants
- type Parser
- type ScrollingRegion
- type State
- type VTerm
- func (v *VTerm) Kill()
- func (v *VTerm) ProcessStdin(in ecma48.Output) []byte
- func (v *VTerm) ProcessStdout(input *bufio.Reader)
- func (v *VTerm) RedrawWindow()
- func (v *VTerm) RefreshCursor()
- func (v *VTerm) Reshape(x, y, w, h int)
- func (v *VTerm) ScrollbackDown()
- func (v *VTerm) ScrollbackReset()
- func (v *VTerm) ScrollbackUp()
Constants ¶
const ( StateGround = iota StateEscape StateCsiEntry StateCsiParam StateOscString )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScrollingRegion ¶
type ScrollingRegion struct {
// contains filtered or unexported fields
}
ScrollingRegion holds the state for an ANSI scrolling region
type VTerm ¶
type VTerm struct { // visible screen; char cursor coords are ignored Screen [][]ecma48.StyledChar // Scrollback[0] is the line farthest from the screen Scrollback [][]ecma48.StyledChar // disabled when using alt screen; char cursor coords are ignored ScrollbackPos int // ScrollbackPos is the number of lines of scrollback visible UsingAltScreen bool NeedsRedraw bool Cursor ecma48.Cursor ChangePause chan bool IsPaused bool DebugSlowMode bool // contains filtered or unexported fields }
VTerm acts as a virtual terminal emulator between a shell and the host terminal emulator
It both transforms an inbound stream of bytes into Char's and provides the option of dumping all the Char's that need to be rendered to display the currently visible terminal window from scratch.
func (*VTerm) Kill ¶
func (v *VTerm) Kill()
Kill safely shuts down all vterm processes for the instance
func (*VTerm) ProcessStdout ¶ added in v0.3.0
func (*VTerm) RedrawWindow ¶
func (v *VTerm) RedrawWindow()
RedrawWindow redraws the screen into ncurses from scratch. This should be reserved for operations not yet formalized into a generic, efficient function.
func (*VTerm) RefreshCursor ¶
func (v *VTerm) RefreshCursor()
RefreshCursor refreshes the ncurses cursor position
func (*VTerm) ScrollbackDown ¶
func (v *VTerm) ScrollbackDown()
ScrollbackDown shifts the screen contents down, with scrollback
func (*VTerm) ScrollbackReset ¶
func (v *VTerm) ScrollbackReset()
func (*VTerm) ScrollbackUp ¶
func (v *VTerm) ScrollbackUp()
ScrollbackUp shifts the screen contents up, with scrollback