Skip to content

Fix Cmd+E incorrectly triggering Extract Thought (requires Cmd+Ctrl+E)#4199

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-extract-thought-command
Draft

Fix Cmd+E incorrectly triggering Extract Thought (requires Cmd+Ctrl+E)#4199
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-extract-thought-command

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

extractThought is bound to { key: 'e', control: true, meta: true } (Cmd+Ctrl+E), but Cmd+E alone was triggering it. Two bugs in src/commands.ts:

  • hashCommand silently dropped the control modifier — { key: 'e', control: true, meta: true } encoded as META_E instead of META_CTRL_E
  • hashKeyDown had no path to emit CTRL_ — Cmd+E and Cmd+Ctrl+E both produced META_E, colliding with the above

Fix:

// hashCommand: include control in the encoded key
(key.meta ? 'META_' : '') +
(key.control ? 'CTRL_' : '') +   // was missing entirely
...

// hashKeyDown: emit CTRL_ only when both Meta+Ctrl held on Mac
(e.metaKey || e.ctrlKey ? 'META_' : '') +
(isMac && e.ctrlKey && e.metaKey ? 'CTRL_' : '') +  // new
...

isMac && e.ctrlKey && e.metaKey is intentional: on Windows e.ctrlKey already maps to META_, so CTRL_ is a Mac-only concept. Requiring both keys prevents Ctrl-alone on Mac from matching Cmd+Ctrl commands.

…md+E from triggering extractThought

Agent-Logs-Url: https://github.com/cybersemics/em/sessions/f88837b7-0616-4c04-912c-f3ef01458c5e

Co-authored-by: raineorshine <750276+raineorshine@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Cmd + E activating Extract Thought command Fix Cmd+E incorrectly triggering Extract Thought (requires Cmd+Ctrl+E) Apr 28, 2026
Copilot AI requested a review from raineorshine April 28, 2026 20:16
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.

[Desktop] Cmd + E and Cmd + Ctrl + E serves as Extract Thought command

2 participants