Add customizable keyboard shortcuts#2425
Closed
nwparker wants to merge 10 commits into
Closed
Conversation
nwparker
force-pushed
the
nwparker/keyboard-custom
branch
from
May 20, 2026 09:27
d027413 to
82fbf79
Compare
nwparker
force-pushed
the
nwparker/keyboard-custom
branch
4 times, most recently
from
May 21, 2026 23:14
96e238c to
73544ac
Compare
- Add customizable keybindings - Fix keybinding customization bypasses
nwparker
force-pushed
the
nwparker/keyboard-custom
branch
from
May 22, 2026 00:36
11c9264 to
83839cb
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a real custom keybinding system for Orca while preserving the current default shortcut ownership model. A shared registry now drives shortcut matching, Settings, file-backed overrides, menu accelerators, browser/terminal handling, conflict checks, and visible shortcut labels.
Users can customize shortcuts through a polished captured-key recorder in Settings > Keyboard Shortcuts or by editing the backing
~/.orca/keybindings.jsonfile directly. The Settings page now includes a keybindings-file split action: Edit in Orca opens the file in the floating workspace editor, while the dropdown offers default-app, external-editor, reveal, and reload paths.Refs #1493, #713, #891, #1502, #858, #1168.
Related: #1802.
Latest UI follow-up
keyboardand clicking Shortcuts could leave Terminal content visible.User-facing behavior
~/.orca/keybindings.jsoninside Orca’s floating workspace editor, open it with the OS default app, open it with an external editor, reveal it in the file manager, or reload it from disk.sidebar.search.togglebinding instead of hardcodingCmd/Ctrl+Shift+F.Defaults and compatibility
This is intentionally customization-first, not a broad terminal/TUI pass-through rewrite.
Cmd+Jon macOS still opens the worktree switcher by default, including when focus is in a terminal/TUI. Users who need that chord for a TUI can disable or rebindworktree.palette.sidebar.checks.toggleis intentionally unassigned by default because the previous UI hint did not correspond to a consistently owned default main-process shortcut.Mod+Shift+Minus/_is no longer treated as a default zoom-out shortcut, so readline/terminal undo can pass through. Users can bind it explicitly if they want that behavior.Implementation
src/shared/keybindings.tsas the shared keybinding registry, parser, formatter, matcher, platform mapper, captured-key normalizer, and conflict detector.src/main/keybindings/keybinding-file.tsandsrc/main/keybindings/keybinding-service.tsfor~/.orca/keybindings.jsonpersistence, migration, validation, and runtime broadcasts.ShortcutsPaneplus stable row UI inShortcutBindingRow.KeybindingsFileActionsfor the backing file card, including in-Orca floating editor open and external/default open paths.Edit in Orcacan read and save a config file outside workspace roots without relaxing general filesystem access.useShortcutLabeland routes visible hints through the effective keybindings.File format
The backing file is JSON and supports both common and per-platform overrides:
{ "version": 1, "keybindings": { "worktree.quickOpen": ["Mod+P"] }, "platforms": { "darwin": { "worktree.palette": ["Mod+J"] }, "linux": {}, "win32": {} } }Notes:
Modmaps toCmdon macOS andCtrlon Linux/Windows.[],null, orfalsedisables an action.Known technical tradeoffs
keybindingssection in JSON.~/.orca/keybindings.jsonfile directly.Testing
Latest local validation after the Settings polish and file-open pass:
pnpm typecheckpnpm lintpnpm exec vitest run --config config/vitest.config.ts src/main/ipc/keybindings.test.ts src/main/keybindings/keybinding-file.test.tsgit diff --checkEdit in Orcaopens/Users/nwparker/.orca/keybindings.jsonin the floating workspace editor and loads JSON content without filesystem access errors.Earlier full focused validation for the PR also passed:
pnpm exec vitest run --config config/vitest.config.ts src/shared/keybindings.test.ts src/renderer/src/components/terminal-pane/keyboard-handlers.test.ts src/renderer/src/web/web-preload-api.test.ts src/main/keybindings/keybinding-file.test.ts src/main/window/createMainWindow.test.ts src/main/menu/register-app-menu.test.ts src/shared/window-shortcut-policy.test.ts src/renderer/src/components/terminal-pane/terminal-shortcut-policy.test.ts src/renderer/src/components/right-sidebar/FileExplorer.test.tsx src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsx src/renderer/src/components/sidebar/WorktreeCard.lineage.test.tsx src/renderer/src/components/sidebar/WorktreeCard.quick-actions.test.tsx