3.4 KiB
Terminal Shortcut Audit And Fix Plan
Context
Linked reports:
#443:Ctrl+R/Cmd+Rreverse search was blocked in the terminal.#453: fixed#443by removing the app-level reload accelerator conflict.#481: reportsCtrl+U(unix-line-discard) being swallowed.#482: reportsCtrl+E(end-of-line) being swallowed, but is marked not reproducible.
The symptom across all four links is "terminal control chord does not reach readline", but the current code shows they are not all the same bug.
Findings
-
#443and#453are directly related.CmdOrCtrl+Rwas reserved above the renderer, so the terminal never saw the chord.#453fixed that by removing the reload accelerator and keeping onlyShift+CmdOrCtrl+Rfor force reload. -
#481and#482are related to the same problem class, but not proven to share#443's exact root cause. CurrentmainWindow.webContents.on('before-input-event', ...)no longer reservesR,U, orE. Current terminal renderer shortcut handling also does not reserve macOSCtrl+R,Ctrl+U, orCtrl+E. -
The real gap was auditability, not just one missing exception. Shortcut interception lived in multiple places:
- main window
before-input-event - browser guest
before-input-event - terminal renderer
keydowncapture
That made it easy to fix one conflict (
Cmd/Ctrl+R) while leaving the overall reservation surface implicit and hard to verify. - main window
Reproduction Matrix
Expected behavior from a focused terminal on macOS:
-
Pass through to shell/readline:
Ctrl+RCtrl+UCtrl+ECtrl+ACtrl+WCtrl+KAlt+BAlt+FAlt+D
-
Reserved by Orca:
Cmd+FCmd+KCmd+WCmd+DCmd+Shift+DCmd+[Cmd+]Cmd+Shift+EnterCtrl+BackspaceCmd+BackspaceCmd+DeleteAlt+Backspace
Expected behavior from main-process/browser-guest forwarding:
-
Reserved:
- zoom shortcuts
- worktree palette
- quick open
- worktree index jump
-
Must never be reserved there:
Cmd/Ctrl+R- readline control chords like
Ctrl+U,Ctrl+E,Ctrl+R
Plan
-
Centralize the window-level shortcut allowlist into a shared pure helper. Why: main-window and browser-guest forwarding should not drift apart, because either one can steal terminal input before the renderer sees it.
-
Centralize terminal-pane shortcut classification into a pure helper. Why: the terminal shortcut layer must stay an explicit allowlist so future shortcuts do not accidentally swallow readline chords.
-
Add regression tests that enumerate both sides:
- allowed Orca shortcuts
- guaranteed shell passthrough chords
-
Keep
#443fixed and make the current status of#481/#482testable. Why: even if one report later turns out to be environment-specific, Orca should still have an executable contract for what it reserves.
Implementation Notes
- Shared helper added for main-process shortcut resolution.
- Shared helper added for terminal-pane shortcut resolution.
- Tests added to encode the allowlist and passthrough matrix explicitly.
Follow-Up Risk
This change makes the current reservation surface auditable, but it does not redesign non-macOS terminal shortcuts. Orca still uses Ctrl as the primary modifier for several terminal actions on Linux/Windows, which is a separate UX question from the macOS control-chord regressions linked above.