Skip to content

fix: audit terminal shortcut interception - #519

Merged
nwparker merged 1 commit into
mainfrom
nwparker/shortcuts
Apr 12, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/shortcuts

Conversation

@nwparker

@nwparker nwparker commented Apr 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Terminal control chords were hard to reason about because Orca intercepted shortcuts in three different places: the main window, browser guests, and the terminal renderer. That made it easy to fix one conflict (Cmd/Ctrl+R in #443 / #453) without having an explicit contract for which shortcuts must always keep reaching readline.

The linked reports (#481 and #482) exposed the broader issue: shortcut interception was not centralized or auditable, so regressions around terminal control keys were likely to recur.

Solution

Centralize shortcut interception into explicit allowlist helpers and add regression tests around the reservation surface.

  • add a shared window shortcut policy used by both the main window and browser-guest forwarding paths
  • add a terminal shortcut policy helper so terminal pane interception is explicit and testable
  • preserve the terminal search navigation behavior added on main while merging it with the new allowlist-based terminal shortcut handling
  • add regression tests that enumerate which chords Orca reserves and which control/readline chords must remain passthrough
  • document the issue relationship, reproduction matrix, and follow-up risk in docs/term-shortcut-fix.md

Testing

  • pnpm exec vitest run --config config/vitest.config.ts src/shared/window-shortcut-policy.test.ts src/renderer/src/components/terminal-pane/terminal-shortcut-policy.test.ts src/main/window/createMainWindow.test.ts src/main/menu/register-app-menu.test.ts src/main/browser/browser-manager.test.ts

Fixes #482 , #481

@nwparker
nwparker force-pushed the nwparker/shortcuts branch from 17ff166 to 031b17e Compare April 12, 2026 06:17
@nwparker
nwparker merged commit c4aabcc into main Apr 12, 2026
1 check passed
@nwparker
nwparker deleted the nwparker/shortcuts branch April 12, 2026 06:24
dylanklohr added a commit to dylanklohr/orca that referenced this pull request Apr 16, 2026
xterm.js emits \e[1;3D / \e[1;3C for option/alt+arrow, which default
readline (bash, zsh) does not bind — so word-by-word navigation silently
doesn't work. Translate to \eb / \ef inside the terminal shortcut policy
so option+←/→ on macOS and alt+←/→ on Linux/Windows match iTerm2's
"Esc+" option-key mode. Extends the stablyai#519 allowlist; no scope beyond
that.

Fixes stablyai#696
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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.

[Not Reproducible] No support for end-of-line shortcut (ctrl + e)

1 participant