Skip to content

Focus tracking (DECSET 1004)

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

DECSET 1004 enables focus in/out event reporting. The sequence is ESC [ ? 1004 h. When the terminal window gains focus, it sends ESC [ I; when it loses focus, it sends ESC [ O. Applications use this to pause animations, dim the UI, or refresh data when the user returns to the window.

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