Skip to content

SGR mouse mode (DECSET 1006)

Category: modes · Tags: DEC Private Modes, Xterm Extensions · Specification ↗

SGR 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.

Supported by 6 of 6 backends (100%)

Support Matrix

BackendVersionSupportNotes
Alacritty0.26.0✓ yes
Ghostty1.3.1✓ yes
Kitty0.40.0✓ yes
vt1000.1.0✓ yes
WezTerm0.1.0-fork.5✓ yes
xterm.js5.5.0✓ yes

Powered by Termless
Playwright for Terminals