Skip to content

Fix Cmd+N when focus is in an agent terminal#92

Merged
mattmoran56 merged 1 commit into
mainfrom
session/fix/cmd-n
May 5, 2026
Merged

Fix Cmd+N when focus is in an agent terminal#92
mattmoran56 merged 1 commit into
mainfrom
session/fix/cmd-n

Conversation

@mattmoran56
Copy link
Copy Markdown
Owner

@mattmoran56 mattmoran56 commented May 4, 2026

Summary

  • xterm.js focuses a hidden .xterm-helper-textarea to capture keystrokes, which tripped the generic TEXTAREA early-return in the Cmd/Ctrl+N handler and swallowed the shortcut whenever an agent terminal had focus.
  • Carve out xterm's input element (and any descendant of .xterm) from the input-text guard. The open-dialog guard ([role="dialog"]) is still respected, so Cmd+N stays suppressed inside modals.

Test plan

  • Open an agent session, click into the terminal, press Cmd+N → New Session dialog opens.
  • Click into a regular text input (e.g. session name field) and press Cmd+N → shortcut is suppressed (no dialog hijack).
  • Open any modal dialog and press Cmd+N → shortcut is suppressed.
  • Cmd+Shift+N / Cmd+Alt+N still do nothing.

🤖 Generated with Claude Code

xterm renders a hidden .xterm-helper-textarea to capture keystrokes,
which tripped the generic TEXTAREA early-return in the Cmd/Ctrl+N
handler and swallowed the shortcut while a terminal had focus.

Carve out xterm's input element (and any descendant of .xterm) from
the input-text guard while still respecting the open-dialog guard.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mattmoran56 mattmoran56 merged commit 56e1cb6 into main May 5, 2026
3 checks passed
@mattmoran56 mattmoran56 deleted the session/fix/cmd-n branch May 5, 2026 07:08
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