TerminalCommandSink
Parser-facing terminal command sink.
This is the narrow semantic handoff boundary from :terminal-parser to :terminal-core.
Rules:
The parser emits terminal operations.
The sink/core owns grid physics, bounds clamping, wrapping, margins, storage, and mode persistence.
The parser must not know terminal width, height, cursor bounds, or rendering details.
Functions
Appends one grapheme-continuation codepoint to the most recently written printable cell without moving the cursor.
Kitty keyboard progressive-enhancement flag application, CSI = flags ; mode u.
Moves the cursor to the left margin on the current row (CR, 0x0D).
Clears all tab stops (TBC 3).
Clears the tab stop at the current cursor column (TBC 0).
Moves the cursor backward (left) by n columns.
Moves the cursor backward (left) by n tab stops.
Moves the cursor down by n rows.
Moves the cursor forward (right) by n columns.
Moves the cursor forward (right) by n tab stops.
Moves the cursor down by n lines and positions it at the beginning of the line.
Moves the cursor up by n lines and positions it at the beginning of the line.
Deletes n characters starting at the cursor position (DCH).
Deletes n lines starting at the cursor row (DL).
De-minimizes (restores/de-iconifies) the terminal window.
Ends the active OSC 8 hyperlink context.
Erases n characters starting at the cursor position (ECH).
Erases cells in the viewport (ED / DECSED).
Erases cells in the active line (EL / DECSEL).
Inserts n blank characters at the cursor position (ICH).
Inserts n blank lines at the cursor row (IL).
Lowers the terminal window to the bottom of the window stack.
Minimizes (iconifies) the terminal window.
Moves the terminal window to the specified screen coordinates in pixels.
Kitty keyboard stack pop, CSI < count u.
Pops the xterm title stack for the given scope.
Kitty keyboard stack push, CSI > flags u.
Xterm title stack push/pop scopes:
Queries a dynamic color.
Queries an individual color in the active 256-color palette.
Queries a status string (DECRQSS).
Queries terminfo capabilities (XTGETTCAP).
Raises the terminal window to the front of the window stack.
Reports an OSC 52 terminal clipboard request.
DA request.
DSR/CPR request: CSI Ps n or CSI ? Ps n.
Safe xterm window report request.
Resets all active pen attributes to defaults (SGR 0).
Resets one xterm key format option, CSI > Pp f.
Resets all supported xterm key format options, CSI > f.
Resets one xterm key modifier option, CSI > Pp m.
Resets all supported xterm key modifier options, CSI > m.
RIS full terminal reset: ESC c.
Requests that the host resize the terminal window to the specified grid dimensions.
Restores the cursor position, SGR attributes, wrap state, and origin mode.
Executes a reverse index (RI, ESC M), moving the cursor up one row.
Saves the current cursor position, SGR attributes, wrap state, and origin mode.
Scrolls the active scroll region down by n lines (SD).
ANSI mode set/reset.
Resets background color to the default.
Sets background indexed color.
Sets background RGB color.
Sets conceal style.
Reports the shell's current working directory as an OSC 7 file URI.
Row and column are parser-translated to zero-origin before handoff. The core may clamp; the parser must not.
Column is parser-translated to zero-origin before handoff. The core may clamp; the parser must not.
Row is parser-translated to zero-origin before handoff. The core may clamp; the parser must not.
Sets the shape/style of the cursor.
DEC private mode set/reset.
Sets a dynamic color (foreground, background, or cursor color).
Resets foreground color to the default.
Sets foreground indexed color.
Sets foreground RGB color.
Sets both icon and window titles.
Sets the icon title.
Sets inverse (reverse-video) style.
Xterm key format option set, CSI > Pp ; Pv f.
Xterm key modifier option set, CSI > Pp ; Pv m.
DECSLRM left/right margins.
Maximizes or restores the terminal window.
Sets overline decoration.
Sets a specific ANSI indexed color.
DECSTBM scroll region.
Sets selective erase protection (DECSCA).
Sets strikethrough decoration.
Sets a tab stop at the current cursor column (HTS).
Resets underline color to the default.
Sets underline indexed color.
Sets underline RGB color.
Sets underline style.
Sets the window title.
Emits a FinalTerm-style OSC 133 shell integration marker.
Requests a desktop notification.
Starts an OSC 8 hyperlink context.
Writes a pre-segmented multi-codepoint grapheme cluster to the grid.
Writes a single Unicode codepoint to the grid at the cursor position.