Skip to content

fix(shortcuts): allow ESC to close dialogs when terminal is focused#55

Open
IShaalan wants to merge 1 commit intojohannesjo:mainfrom
IShaalan:fix/esc-in-keyboard-shortcuts-dialog-253632
Open

fix(shortcuts): allow ESC to close dialogs when terminal is focused#55
IShaalan wants to merge 1 commit intojohannesjo:mainfrom
IShaalan:fix/esc-in-keyboard-shortcuts-dialog-253632

Conversation

@IShaalan
Copy link
Copy Markdown

@IShaalan IShaalan commented Apr 4, 2026

Summary

  • When a dialog (Help, Settings, New Task) is open and a terminal has focus, pressing ESC now correctly closes the dialog instead of being swallowed by xterm.js
  • matchesGlobalShortcut now also passes dialogSafe shortcuts through xterm when a .dialog-overlay is present in the DOM
  • ESC still reaches the terminal normally when no dialog is open (vim, readline, etc. unaffected)

Test plan

  • Open keyboard shortcuts dialog (Cmd+/ or F1), click into a terminal, press ESC — dialog should close
  • Open settings dialog, click into a terminal, press ESC — dialog should close
  • With no dialog open, press ESC in terminal — should reach the terminal as before (e.g. exit vim insert mode)
  • Cmd+/ and F1 still toggle the help dialog from terminal focus (unchanged, already had global: true)

🤖 Generated with Claude Code

matchesGlobalShortcut now also passes dialogSafe shortcuts through
xterm.js when a dialog overlay is open, so ESC reaches the window-level
handler that closes the dialog instead of being swallowed by the terminal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant