TerminalWriter
Write-side contract for the terminal buffer.
Consumed by the ANSI parser to push character data and control codes into the active screen. All operations target the cursor's current position unless otherwise stated.
The core is intentionally spatial rather than temporal. Parser layers are expected to decide grapheme-cluster boundaries and call either the scalar fast path (writeCodepoint) or the explicit cluster ingress (writeCluster).
Inheritors
Functions
Appends one grapheme-continuation codepoint to the most recently written printable cell without moving the cursor.
Executes a carriage return (CR, 0x0D).
Clears the visible screen and homes the cursor (equivalent to ED 2 + CUP).
Deletes count characters at the cursor column, shifting the remainder of the line left and filling the vacated right cells with blanks using the active pen attribute (DCH, CSI n P). Cursor position is not changed.
Deletes count lines starting at the cursor row within the active scroll region (DL, CSI n M).
Erases count characters starting at the cursor column without shifting the remainder of the line (ECH, CSI n X).
Erases the entire current line without moving the cursor (EL 2, CSI 2 K).
Erases the entire visible screen without moving the cursor (ED 2, CSI 2 J).
Erases from the start of the current line through the cursor (EL 1, CSI 1 K).
Erases from the cursor to the end of the current line (EL 0, CSI 0 K).
Erases all scrollback history while preserving the visible viewport (xterm/VTE ED 3, CSI 3 J).
Erases from the start of the visible screen through the cursor (ED 1, CSI 1 J).
Erases from the cursor to the end of the visible screen (ED 0, CSI 0 J).
Inserts count blank cells at the cursor column, shifting existing cells right (ICH, CSI n @). Cells pushed past the right margin are discarded.
Inserts count blank lines at the cursor row within the active scroll region (IL, CSI n L).
Resets the scroll region to the full viewport and homes the cursor.
Executes Reverse Index (RI, ESC M).
Scrolls the active scroll region down by one line (SD, CSI 1 T).
Selectively erases the entire current line without moving the cursor (DECSEL 2).
Selectively erases the entire visible screen without moving the cursor (DECSED 2).
Selectively erases from the start of the current line through the cursor (DECSEL 1).
Selectively erases from the cursor to the end of the current line (DECSEL 0).
Selectively erases from the start of the visible screen through the cursor (DECSED 1).
Selectively erases from the cursor through the end of the visible screen (DECSED 0).
Sets the active OSC 8 hyperlink id stamped onto future printed cells.
Sets the xterm icon title.
Sets the active horizontal margins (DECSLRM, CSI left ; right s).
Sets the active pen attributes used by all subsequent write and erase operations.
Sets the active pen attributes using explicit default, indexed, or RGB colors.
Sets the active vertical scroll region (DECSTBM, CSI top ; bottom r).
Enables or disables selective-erase protection on future printed cells (DECSCA).
Sets the xterm window title.
Writes one pre-segmented grapheme cluster to the grid.
Writes one Unicode scalar value at the cursor position using the active pen attributes, then advances the cursor.