pub enum Action {
Show 62 variants
Print(char),
Newline,
CarriageReturn,
Tab,
Backspace,
Bell,
CursorUp(u16),
CursorDown(u16),
CursorRight(u16),
CursorLeft(u16),
CursorNextLine(u16),
CursorPrevLine(u16),
CursorColumn(u16),
CursorRow(u16),
SetScrollRegion {
top: u16,
bottom: u16,
},
ScrollUp(u16),
ScrollDown(u16),
InsertLines(u16),
DeleteLines(u16),
InsertChars(u16),
DeleteChars(u16),
CursorPosition {
row: u16,
col: u16,
},
EraseInDisplay(u8),
EraseInLine(u8),
Sgr(CsiParams),
DecSet(CsiParams),
DecRst(CsiParams),
AnsiSet(CsiParams),
AnsiRst(CsiParams),
SaveCursor,
RestoreCursor,
Index,
ReverseIndex,
NextLine,
FullReset,
SetTitle(String),
HyperlinkStart(String),
HyperlinkEnd,
SetTabStop,
ClearTabStop(u16),
BackTab(u16),
ApplicationKeypad,
NormalKeypad,
EraseChars(u16),
ScreenAlignment,
RepeatChar(u16),
SetCursorShape(u8),
SoftReset,
EraseScrollback,
FocusIn,
FocusOut,
PasteStart,
PasteEnd,
DeviceAttributes,
DeviceAttributesSecondary,
DeviceStatusReport,
CursorPositionReport,
DesignateCharset {
slot: u8,
charset: u8,
},
SingleShift2,
SingleShift3,
MouseEvent {
button: u16,
col: u16,
row: u16,
pressed: bool,
},
Escape(Vec<u8>),
}Expand description
Parser output actions.
Variants§
Print(char)
Print a single character (ASCII or multi-byte UTF-8).
Newline
Line feed / newline (\n).
CarriageReturn
Carriage return (\r).
Tab
Horizontal tab (\t).
Backspace
Backspace (\x08).
Bell
Bell (\x07).
CursorUp(u16)
CUU (CSI Ps A): move cursor up by count (default 1).
CursorDown(u16)
CUD (CSI Ps B): move cursor down by count (default 1).
CursorRight(u16)
CUF (CSI Ps C): move cursor right by count (default 1).
CursorLeft(u16)
CUB (CSI Ps D): move cursor left by count (default 1).
CursorNextLine(u16)
CNL (CSI Ps E): move cursor down by count and to column 0.
CursorPrevLine(u16)
CPL (CSI Ps F): move cursor up by count and to column 0.
CursorColumn(u16)
CHA (CSI Ps G): move cursor to absolute column (0-indexed).
CursorRow(u16)
VPA (CSI Ps d): move cursor to absolute row (0-indexed).
SetScrollRegion
DECSTBM (CSI Pt ; Pb r): set scrolling region. bottom == 0 means
“use full height” (default), since the parser does not know the grid size.
top is 0-indexed inclusive. bottom is 0-indexed exclusive when non-zero.
ScrollUp(u16)
SU (CSI Ps S): scroll the scroll region up by count (default 1).
ScrollDown(u16)
SD (CSI Ps T): scroll the scroll region down by count (default 1).
InsertLines(u16)
IL (CSI Ps L): insert blank lines at cursor row within scroll region.
DeleteLines(u16)
DL (CSI Ps M): delete lines at cursor row within scroll region.
InsertChars(u16)
ICH (CSI Ps @): insert blank cells at cursor column.
DeleteChars(u16)
DCH (CSI Ps P): delete cells at cursor column.
CursorPosition
CUP/HVP: move cursor to absolute 0-indexed row/col.
EraseInDisplay(u8)
ED mode (CSI Ps J): 0, 1, or 2.
EraseInLine(u8)
EL mode (CSI Ps K): 0, 1, or 2.
Sgr(CsiParams)
SGR (CSI ... m): set graphics rendition parameters (attributes/colors).
Parameters are returned as parsed numeric values; interpretation is performed by the terminal engine (they are stateful/delta-based).
DecSet(CsiParams)
DECSET (CSI ? Pm h): enable DEC private mode(s).
DecRst(CsiParams)
DECRST (CSI ? Pm l): disable DEC private mode(s).
AnsiSet(CsiParams)
SM (CSI Pm h): enable ANSI standard mode(s).
AnsiRst(CsiParams)
RM (CSI Pm l): disable ANSI standard mode(s).
SaveCursor
DECSC (ESC 7): save cursor state.
RestoreCursor
DECRC (ESC 8): restore cursor state.
Index
IND (ESC D): index — move cursor down one line, scrolling if at bottom.
ReverseIndex
RI (ESC M): reverse index — move cursor up one line, scrolling if at top.
NextLine
NEL (ESC E): next line — move cursor to start of next line.
FullReset
RIS (ESC c): full reset to initial state.
SetTitle(String)
OSC 0/2: set terminal title.
HyperlinkStart(String)
OSC 8: start a hyperlink with the given URI.
HyperlinkEnd
OSC 8: end the current hyperlink.
SetTabStop
HTS (ESC H): set a tab stop at the current cursor column.
ClearTabStop(u16)
TBC (CSI Ps g): tab clear. 0 = at cursor, 3 = all tab stops.
BackTab(u16)
CBT (CSI Ps Z): cursor backward tabulation by count (default 1).
ApplicationKeypad
DECKPAM (ESC =): application keypad mode.
NormalKeypad
DECKPNM (ESC >): normal keypad mode.
EraseChars(u16)
ECH (CSI Ps X): erase characters at cursor position (replace with blanks).
ScreenAlignment
DECALN (ESC # 8): DEC screen alignment test — fill entire grid with ‘E’.
RepeatChar(u16)
REP (CSI Ps b): repeat the most recently printed graphic character Ps times.
SetCursorShape(u8)
DECSCUSR (CSI Ps SP q): set cursor shape.
0 = default, 1 = blinking block, 2 = steady block, 3 = blinking underline, 4 = steady underline, 5 = blinking bar, 6 = steady bar.
SoftReset
DECSTR (CSI ! p): soft terminal reset.
Resets most terminal state (modes, SGR, scroll region, cursor
visibility, character sets) without clearing the screen or
scrollback — unlike RIS (ESC c) which is a full reset.
EraseScrollback
ED mode 3 (CSI 3 J): erase the entire display and scrollback buffer.
FocusIn
Focus gained (CSI I): terminal window received focus.
FocusOut
Focus lost (CSI O): terminal window lost focus.
PasteStart
Bracketed paste start (CSI 200 ~).
PasteEnd
Bracketed paste end (CSI 201 ~).
DeviceAttributes
DA1 (CSI c / CSI 0 c): request primary device attributes.
DeviceAttributesSecondary
DA2 (CSI > c / CSI > 0 c): request secondary device attributes.
DeviceStatusReport
DSR (CSI 5 n): device status report — “are you OK?” query.
CursorPositionReport
CPR (CSI 6 n): cursor position report — request current cursor position.
DesignateCharset
Designate character set for slot G0..G3.
slot: 0 = G0 (ESC (), 1 = G1 (ESC )), 2 = G2 (ESC *), 3 = G3 (ESC +).
charset: b’B’ = ASCII (USASCII), b’0’ = DEC Special Graphics, etc.
SingleShift2
SS2 (ESC N): single shift to G2 for the next printed character only.
SingleShift3
SS3 (ESC O): single shift to G3 for the next printed character only.
MouseEvent
Mouse event from SGR mode 1006 (CSI < Pb ; Px ; Py M/m) or
legacy X10 mode 1000 (CSI M Cb Cx Cy).
button: 0 = left, 1 = middle, 2 = right, 3 = release (legacy),
64 = scroll up, 65 = scroll down. Modifier bits: 4 = shift, 8 = meta, 16 = ctrl.
col/row: 0-based cell coordinates.
pressed: true for press/motion, false for release.
Escape(Vec<u8>)
A raw escape/CSI/OSC sequence captured verbatim (starts with ESC).