You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Terminal programs requesting DEC 1004 receive no focus reports #37065
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/web (also used by desktop)
Steps to reproduce
Open a thread's terminal drawer.
Run stty -echo -icanon; printf '\033[?1004h'; cat -v to request focus reporting.
Click the chat composer, then focus the terminal again.
Press Ctrl+C, then run printf '\033[?1004l'; stty sane to restore the terminal.
Expected behavior
The program receives ESC[O when the terminal loses focus and ESC[I when it gains focus. Disabling DEC 1004 stops these reports.
Actual behavior
No focus reports reach the program. The Ghostty surface updates cursor visuals without sending focus events to the PTY. Programs requesting focus reporting cannot react to focus changes. This regressed during the xterm.js to Ghostty migration.
Impact
Minor bug or occasional failure. Affects programs explicitly enabling DECSET 1004; no incidence estimate.
Linux, Chromium, isolated development web app. Desktop shares the web terminal implementation. Mobile uses separate native implementations and is outside this fix.
Logs or stack traces
The focused real-WASM surface test expects ["\u001b[I", "\u001b[O"] and receives [] on main. A real-app scenario confirms mode 1004 through DECRQM before testing PTY bytes.
Screenshots, recordings, or supporting files
Fix PR contains the base-versus-head scenario proof and captures.
Activity