Documentation
¶
Index ¶
- Constants
- type APC
- type C0
- type CSI
- func (seq CSI) ColonAfter(i int) bool
- func (seq CSI) Command() string
- func (seq CSI) Intermediates() []rune
- func (seq CSI) Param(i int) int
- func (seq CSI) ParamGroup(i int) []uint32
- func (seq CSI) ParamGroupAt(i int) ([]uint32, int)
- func (seq CSI) ParameterGroups() [][]int
- func (seq CSI) Params() []uint32
- func (seq CSI) String() string
- type DCS
- type EOF
- type ESC
- type OSC
- type Parser
- type ParserMode
- type Print
- type SS3
- type Sequence
Constants ¶
const ( MaxIntermediate = 4 MaxCSIParams = 24 InlineCSIParams = 12 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSI ¶
type CSI struct {
Intermediate [MaxIntermediate]rune
NumIntermediate int
Parameters [InlineCSIParams]uint32
ExtraParameters []uint32
NumParameters int
ColonSeparators uint32
Final rune
}
A CSI Sequence
func (CSI) ColonAfter ¶
func (CSI) Intermediates ¶
func (CSI) ParamGroup ¶
func (CSI) ParameterGroups ¶
type DCS ¶
type DCS struct {
Final rune
Intermediate [MaxIntermediate]rune
NumIntermediate int
Parameters [InlineCSIParams]uint32
ExtraParameters []uint32
NumParameters int
Data []rune
}
Sent at the beginning of a DCS passthrough sequence.
func (DCS) Intermediates ¶
type ESC ¶
type ESC struct {
Intermediate [MaxIntermediate]rune
NumIntermediate int
Final rune
}
An escape sequence with intermediate characters
func (ESC) Intermediates ¶
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 OSC Execute the OSC sequence DCS Execute the DCS sequence EOF Sent at end of input
type ParserMode ¶
type ParserMode int
ParserMode controls how ambiguous parser input is interpreted.
const ( // ParserModeInput parses terminal input, where a bare ESC keypress must be // disambiguated from the start of a longer escape sequence. ParserModeInput ParserMode = iota // ParserModeOutput parses application output, where ESC always starts an // output control sequence and should not be emitted by a timer. ParserModeOutput )