Add synchronized output support (DEC mode 2026)

Implement synchronized output mode (CSI ? 2026 h/l) which allows
applications to batch terminal updates and render them atomically,
preventing screen tearing during rapid output.

Features:
- BSU (CSI ? 2026 h) pauses rendering, buffering row updates
- ESU (CSI ? 2026 l) flushes buffer and renders atomically
- Configurable timeout via synchronizedOutputTimeout option (default 5s)
- Exposed via terminal.modes.synchronizedOutputMode

Closes #3375

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Chris Lloyd
2025-12-04 11:16:25 -08:00
co-authored by Claude
parent 46c510a76d
commit 7228e2e2dc
10 changed files with 602 additions and 10 deletions
+16
View File
@@ -281,6 +281,15 @@ declare module '@xterm/xterm' {
*/
smoothScrollDuration?: number;
/**
* The timeout in milliseconds for synchronized output mode (DEC mode 2026).
* When an application enables synchronized output but fails to disable it
* within this timeout, the terminal will automatically flush buffered
* output to prevent the display from freezing indefinitely. Set to 0 to
* disable the timeout (not recommended). The default is 5000 (5 seconds).
*/
synchronizedOutputTimeout?: number;
/**
* The size of tab stops in the terminal.
*/
@@ -1968,6 +1977,13 @@ declare module '@xterm/xterm' {
* Send FocusIn/FocusOut events: `CSI ? 1 0 0 4 h`
*/
readonly sendFocusMode: boolean;
/**
* Synchronized Output Mode: `CSI ? 2 0 2 6 h`
*
* When enabled, output is buffered and only rendered when the mode is
* disabled, allowing for atomic screen updates without tearing.
*/
readonly synchronizedOutputMode: boolean;
/**
* Auto-Wrap Mode (DECAWM): `CSI ? 7 h`
*/