Skip to content

fix(shortcuts): handle command palette in terminal#2701

Open
janburzinski wants to merge 6 commits into
mainfrom
emdash/cmdk-not-working-windows-wovyp
Open

fix(shortcuts): handle command palette in terminal#2701
janburzinski wants to merge 6 commits into
mainfrom
emdash/cmdk-not-working-windows-wovyp

Conversation

@janburzinski

Copy link
Copy Markdown
Collaborator

Description

on windows when you were tabbed in in a terminal the ctrl+k keybind didnt work since xterm swallowed it, this should fix it and make it work on all platforms.

  • only intercepts explicitly allowlisted shortcuts (shortcut-registry)

Screenshot/Recording (if applicable)

https://streamable.com/z9bng0

Checklist
  • I kept this PR small and focused
  • I ran a self-review before opening this PR
  • I ran the relevant local checks or explained why not
  • I updated docs when behavior or setup changed
  • I added or updated tests when behavior changed, or explained why not
  • I only added comments where the logic is not obvious
  • I used Conventional Commits for commit
    messages and, when possible, the PR title

@greptile-apps

greptile-apps Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes app shortcuts work while an xterm terminal is focused. The main changes are:

  • Adds a terminal keyboard bridge mounted in the workspace.
  • Dispatches only shortcuts marked with overrideTerminalFocus.
  • Prevents handled terminal-focused shortcuts from reaching xterm or the normal bubbling listener.
  • Adds browser tests for terminal focus, duplicate registrations, and non-allowlisted keys.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/emdash-desktop/src/renderer/lib/components/terminal-keyboard-bridge.tsx Adds the capture-phase bridge that dispatches allowlisted shortcuts and cancels handled terminal key events.
apps/emdash-desktop/src/shared/shortcuts.ts Adds the overrideTerminalFocus shortcut field and marks selected app shortcuts for terminal-focused dispatch.
apps/emdash-desktop/src/renderer/app/workspace.tsx Mounts the terminal keyboard bridge with the existing workspace shortcut helpers.
apps/emdash-desktop/src/renderer/tests/browser/terminal-keyboard-bridge.test.tsx Adds browser tests for handled shortcuts, duplicate registrations, terminal pass-through, and non-terminal focus.

Reviews (3): Last reviewed commit: "fix(shortcuts): preserve app navigation ..." | Re-trigger Greptile

Comment thread apps/emdash-desktop/src/renderer/lib/components/terminal-keyboard-bridge.tsx Outdated
Comment thread apps/emdash-desktop/src/renderer/lib/components/terminal-keyboard-bridge.tsx Outdated
@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

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