wire / terminal-dec-private-mode / 1004

DECSET 1004 — Focus reporting

CSI ? 1004 h enables focus event reporting: the terminal sends CSI I when the window gains focus and CSI O when it loses focus. CSI ? 1004 l disables it. Apps use this to pause animations, refresh on focus, or change cursor styling.

terminal-dec-private-mode kind control-sequence status de-facto verification verified tier B terminal-escape@1

aka: focus reporting · focus events · DECSET 1004 · ?1004h / ?1004l · CSI I · CSI O

frame

DEC-private-mode introducer: \x1b[? ESC [ ? (0x1B 0x5B 0x3F)

terminator (none): ST · BEL

parameters / subcommands

idnamebytes (ST)meaning
set Enable (DECSET) \x1b[?1004h CSI ? 1004 h enables focus reporting: on focus-in the terminal sends ESC [ I (CSI I) and on focus-out ESC [ O (CSI O).
reset Disable (DECRST) \x1b[?1004l CSI ? 1004 l disables focus reporting; no focus events are sent.

gotchas


provenance

per-fact attribution:

see also

agent: curl -H 'accept: application/json' wire.phall.io/terminal-dec-private-mode/1004 or /terminal-dec-private-mode/1004.json