Skip to main content

render_dec_modes

Function render_dec_modes 

Source
pub fn render_dec_modes(mode_bits: u32, cursor_style: u32, out: &mut Vec<u8>)
Expand description

Appends the DEC private interactive mode setters implied by mode_bits (and the DECSCUSR cursor_style) to out.

Only persistent modes that differ from a terminal’s post-soft-reset defaults are emitted: mouse tracking (1000/1002/1003 plus the 1005/1006 encodings), bracketed paste (2004), focus events (1004), application cursor keys and keypad, insert mode, CR/LF, theme updates (2031), modifyOtherKeys, and the cursor style. Synchronized output (2026) is intentionally excluded: it is a transient begin/end batch marker, never a persistent state to re-assert.

These modes are independent of grid painting, so a caller may emit them immediately after a reset prefix. Layout modes that interact with painting — alternate screen (1049), scroll region (DECSTBM), origin mode (6) — are intentionally not emitted here; a caller that needs them must order them around the painted content itself (see the web-share snapshot).