Appearance
SGR mouse mode (DECSET 1006)
ESC [ ? 1006 hSGR mouse mode replaces the legacy X10 mouse encoding with a format that supports arbitrarily large coordinates. Enable with
ESC [ ? 1006 h (in addition to a tracking mode like ?1000 or ?1003). Mouse events are reported as ESC [ < button ; col ; row M for press and ESC [ < button ; col ; row m for release.
The SGR format solves critical limitations of legacy mouse reporting: coordinates are decimal (no 223-column limit), button press and release are distinguishable by the final character (M vs m), and the format is unambiguous (no byte-value collisions with control characters). All modern TUI frameworks use SGR mouse mode.How this is testedautomated
Enable SGR mouse (
Enable SGR mouse (
CSI ? 1006 h), check getMode("sgrMouse") returns true. Confirms the backend tracks SGR mouse encoding mode.The same probe runs against headless backends (via Termless) and real terminal apps (via a daemon launched in each terminal). This lets us distinguish parser correctness from rendering correctness.
Analysis2026-04-06
Supported by 11 of 12 terminals (92%). Not supported by: vt100.js. Part of the Modern TUI baseline. Notes: vt100.js: SGR mouse encoding not implemented — pure TypeScript emulator.
Supported by 9 of 14 backends (64%)
Terminal Applications
| Terminal | Version | Support | Notes |
|---|---|---|---|
| iTerm2 | 3.6.9 | ✓ yes | DECRPM: mode reset |
| Ghostty | 1.3.1 | ✓ yes | DECRPM: mode reset |
| VS Code | ✓ yes | ||
| Warp | ✓ yes | ||
| Cursor | ✓ yes | ||
| Terminal.app | ✓ yes |
Headless Backends
Parser correctness only — a ✓ means the parser accepts the sequence.
| Backend | Version | Support | Notes |
|---|---|---|---|
| vterm | 0.2.0 | ✓ yes | |
| Alacritty | 0.26.0 | ~ partial | SGR mouse encoding not exposed via alacritty_terminal API |
| Kitty | 0.40.0 | ~ partial | SGR mouse encoding not exposed via Python batch bridge |
| WezTerm | 0.1.0-fork.5 | ~ partial | SGR mouse encoding not exposed via wezterm-term API |
| xterm.js | 5.5.0 | ~ partial | SGR mouse encoding not exposed in xterm.js headless mode |
| vt100.js | 0.2.1 | ✗ no | SGR mouse encoding not implemented — pure TypeScript emulator |