fix(web): recognize dead-key Backquote shortcuts #9815
main fromrefs/pull/9815/head·opened View on GitHubWhen a browser reports Ctrl+Backquote as key: "Dead", Settings cannot record it and a saved Backquote binding does not match the event. Use code: "Backquote" to recover the key during capture for Dead/Unidentified events and add Backquote to the runtime's existing physical-key aliases.
Validation: all 70 tests in the keybinding capture and shortcut matching suites pass. Four new cases fail against unchanged upstream and pass with the fix. Web typecheck, targeted lint, and formatting pass. Chromium verification sends the Dead/Backquote/Ctrl event through the browser input protocol: upstream leaves the capture field empty; the fix records and saves the binding, and the same event opens and closes the terminal drawer. This simulates the browser event; no physical keyboard-layout or separate Electron test was run.
| Before | After |
|---|---|
Before video
https://github.com/user-attachments/assets/169f78fc-1f3a-4d63-a08b-3b3d4518c854
After video
https://github.com/user-attachments/assets/21daf25a-5d19-42af-aa7d-f65647b32005
Model: GPT-6. Harness: Codex in T3 Code.
Note
Low Risk Scoped change to key token normalization and one physical-key alias; dead-key inference is limited to Backquote with explicit code.
Overview
Fixes Ctrl+Backquote (and similar) shortcuts when the browser reports key: "Dead" or "Unidentified" instead of a literal backtick—Settings could not record the binding and saved shortcuts would not fire.
Settings capture: normalizeShortcutKeyToken and keybindingFromKeyboardEvent now accept optional KeyboardEvent.code. When key is Dead/Unidentified and code === "Backquote", capture resolves to mod+\. Other dead keys stay ignored (no broad guessing); unmodified Backquote still returns null.
Runtime matching: Adds Backquote → []` to the existing physical-key alias map in resolveEventKeys, so the same events match bindings stored as ` (e.g. terminal toggle).
New tests cover capture, non-Backquote dead keys, and resolveShortcutCommand for Dead/Unidentified/` with code: "Backquote".
Note
Fix Backquote shortcut recognition for dead-key keyboard events#
- Browsers on certain keyboard layouts report Ctrl+Backquote as
DeadorUnidentifiedinstead of the literal backtick, causing the shortcut to fail normalizeShortcutKeyTokennow accepts an optional physicalcodeand normalizesDead/Unidentifiedtobacktickonly whencodeisBackquote; unrelated dead keys are still rejectedkeybindingFromKeyboardEventforwards the event'scodeto the normalizer, andEVENT_CODE_KEY_ALIASESmapsBackquoteto thebackticktoken for command resolution- Risk: none — unmodified
Backquoteinput and non-Backquotedead keys remain unsupported
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
7dc4ab2Macroscope's review found this PR approvable — This is a narrowly scoped keyboard-event fix that recognizes Backquote when browsers report Dead or Unidentified, without changing stored defaults or unrelated shortcut behavior. Production changes are isolated and covered by focused capture and runtime-matching tests.
Notes:
- Diff unchanged. Approvability was decided on eligibility alone.
juliusmarminge added labelsmacroscope-review
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Note
Written by
claude-opus-5-5on behalf of MariaHi! We are cleaning up open PRs, and this one appears to have been created with an older model (
gpt-6). If this change is really important, we recommend rebuilding the PR with a newer model if possible.maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed