Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): recognize dead-key Backquote shortcuts #9815

Closedasfires(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/9815/headopened View on GitHub

When 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.

BeforeAfter
BeforeAfter

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".

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7dc4ab210a095a67e5233bb2b0e416efd1283042. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Fix Backquote shortcut recognition for dead-key keyboard events

  • Browsers on certain keyboard layouts report Ctrl+Backquote as Dead or Unidentified instead of the literal backtick, causing the shortcut to fail
  • normalizeShortcutKeyToken now accepts an optional physical code and normalizes Dead/Unidentified to backtick only when code is Backquote; unrelated dead keys are still rejected
  • keybindingFromKeyboardEvent forwards the event's code to the normalizer, and EVENT_CODE_KEY_ALIASES maps Backquote to the backtick token for command resolution
  • Risk: none — unmodified Backquote input and non-Backquote dead keys remain unsupported
Macroscope summarized 7dc4ab2.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 7dc4ab2

      Macroscope'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.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. juliusmarminge added labelsmacroscope-review

    4. Note

      Written by claude-opus-5-5 on behalf of Maria

      Hi! 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.

    5. maria-rcks closed this

Sign in to join this conversation.