#[non_exhaustive]pub enum Command<'a> {
Show 26 variants
MoveCursor(CursorMove),
SaveCursorPosition,
RestoreCursorPosition,
SetCursorVisible(bool),
SetCursorBlinking(bool),
SetCursorAppearance(CursorAppearance),
SetAlternateScreen(bool),
SetBracketedPaste(bool),
SetFocusReporting(bool),
SetMouseCapture(bool),
PushKeyboardEnhancement(KeyboardEnhancementFlags),
PopKeyboardEnhancement,
Clear(ClearRegion),
Scroll(i32),
SetSize(TerminalSize),
SetTitle(TerminalText<'a>),
SetLineWrap(bool),
SetSynchronizedUpdate(bool),
SetStyle(TerminalStyle),
ResetStyle,
SetHyperlink(Option<TerminalHyperlink<'a>>),
ApplicationProgram(ControlString<'a>),
DeviceControl(ControlString<'a>),
Print(TerminalText<'a>),
LineFeed,
CarriageReturnLineFeed,
}Expand description
One semantic terminal control or text-output operation.
Commands model terminal behavior rather than a backend library’s command types. A surface owns when commands run; a backend owns how they reach the terminal. Their conventional wire forms belong to the ANSI family: CSI sequences control cursor, modes, erasure, and SGR style; OSC strings carry titles and hyperlinks; printable UTF-8 and C0 line endings are raw bytes. An adapter may use native platform operations instead of those encodings.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MoveCursor(CursorMove)
Moves the cursor using a CSI cursor-positioning or movement sequence.
SaveCursorPosition
Saves the cursor position using the backend’s ANSI/DEC save sequence.
RestoreCursorPosition
Restores the cursor position using the backend’s ANSI/DEC restore sequence.
SetCursorVisible(bool)
Shows or hides the cursor using a CSI private-mode sequence.
SetCursorBlinking(bool)
Enables or disables cursor blinking using a CSI private-mode sequence.
SetCursorAppearance(CursorAppearance)
Selects a cursor shape using a CSI cursor-style sequence.
SetAlternateScreen(bool)
Selects the primary or alternate screen using a CSI private-mode sequence.
SetBracketedPaste(bool)
Enables or disables bracketed-paste reporting using a CSI private-mode sequence.
SetFocusReporting(bool)
Enables or disables terminal-focus reporting using a CSI private-mode sequence.
SetMouseCapture(bool)
Enables or disables mouse reporting using CSI private-mode sequences.
PushKeyboardEnhancement(KeyboardEnhancementFlags)
Pushes enhanced-keyboard flags using the terminal’s CSI protocol.
PopKeyboardEnhancement
Pops the most recently pushed enhanced-keyboard flags using CSI.
Clear(ClearRegion)
Clears terminal content using a CSI erase sequence.
Scroll(i32)
Scrolls by signed rows. Positive values move content upward.
Backends normally lower this to CSI scroll-up or scroll-down sequences.
SetSize(TerminalSize)
Requests a terminal size using a CSI window-manipulation sequence.
SetTitle(TerminalText<'a>)
Sets the terminal title using an OSC control string.
SetLineWrap(bool)
Enables or disables automatic line wrapping using a CSI private-mode sequence.
SetSynchronizedUpdate(bool)
Begins or ends a synchronized update using a CSI private-mode sequence.
SetStyle(TerminalStyle)
Applies a complete physical text style using CSI SGR sequences.
ResetStyle
Restores the terminal’s default text style using CSI SGR sequences.
SetHyperlink(Option<TerminalHyperlink<'a>>)
Starts or ends a hyperlink using an OSC 8 control string.
ApplicationProgram(ControlString<'a>)
Sends an ECMA-48 Application Program Command control string.
Extension crates use this transport for protocols such as Kitty graphics while retaining ownership of the protocol payload itself.
DeviceControl(ControlString<'a>)
Sends an ECMA-48 Device Control String.
Extension crates use this transport for protocols such as Sixel while retaining ownership of the protocol payload itself.
Print(TerminalText<'a>)
Writes the UTF-8 text bytes without interpreting them as terminal control data.
LineFeed
Writes the raw C0 line-feed byte without a carriage return.
CarriageReturnLineFeed
Writes raw C0 carriage-return and line-feed bytes.