Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

docs(keybindings): correct the recorder's menu-accelerator claims

enesa67cef89991b
diff --git a/CLAUDE.md b/CLAUDE.md
index 610354dd4..8b3716a83 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -1956,9 +1956,16 @@ the Settings section and ShortcutsPanel start disagreeing about what a chord mea
why their capture NOTICE is raised at the IPC receivers in `Canvas.tsx` rather than by the
dispatcher. **Reload (⌘R / ⌘⇧R) is the named exception and stays live while stood down**: it is
the crash-recovery lever (a wedged renderer is exactly when it is needed) and a main-frame
- navigation is one of the three sites that reset `terminalFocused` / `shortcutRecording`. It is
- therefore also the one chord a shortcut recorder can never capture, which is what the Keyboard
- Shortcuts section's description now says.
+ navigation is one of the three sites that reset `terminalFocused` / `shortcutRecording`. **Of the
+ items main suspends, Reload is therefore the deliberate exception** — the one it holds back from a
+ shortcut recorder — which is what the Keyboard Shortcuts section's description now says.
+ **KNOWN GAP, pre-existing and accepted:** the suspend list only ever covered the command-style
+ items the terminal-first policy needed, so the always-on app roles — `quit` (⌘Q), `hide` /
+ `hideOthers` (⌘H / ⌘⌥H), `toggleDevTools`, `togglefullscreen` — still act while a recorder is
+ armed (⌘Q pressed into one QUITS the app). They are deliberately NOT added: ONE list drives both
+ stand-downs, and making ⌘Q/⌘H unreachable for a terminal-first user is the worse trade — quit and
+ hide must never be policy-gated. Splitting the list per stand-down is the change that would close
+ it, and it has not been made.
`keydown-intercept.test.ts` pins both the stolen chords and the suspended item ids (including
that the list does not silently grow) — `getMenuItemById` answers `null` for a typo and the
fail-safe is to do nothing, which is indistinguishable from the feature working.
diff --git a/src/main/index.ts b/src/main/index.ts
index 33262da70..17233ed7e 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -332,7 +332,9 @@ settingsStore.onChange((s) => {
// 1. `shortcutRecording` — Settings' shortcut recorder is armed: stand every intercept down so the
// chord the user presses reaches the recorder. Without it, recording ⌘W CLOSES THE SELECTED
// NODES — a claimed chord never reaches the page, so the recorder's own preventDefault cannot
-// save it.
+// save it. It ALSO drives the menu leg (`menuStandsDown` → `syncMenuForStandDown`, called from
+// this bit's IPC receiver), which is what lets a menu-owned chord — ⌘M, ⌘⇧B, ⌘,, off-mac
+// Ctrl+W — reach the recorder instead of the item that owns it.
// 2. `terminalFocused` — an xterm holds keyboard focus, which under the `terminal-first` policy
// means the intercepts stand down so the terminal gets the chord. `before-input-event` fires
// before any renderer handler could answer, so the answer has to be sitting here in advance;
diff --git a/src/main/keydown-intercept.ts b/src/main/keydown-intercept.ts
index 08a6f0ede..66ae803bc 100644
--- a/src/main/keydown-intercept.ts
+++ b/src/main/keydown-intercept.ts
@@ -281,6 +281,14 @@ export const MENU_ITEM_ID_SETTINGS = 'app-settings'
* ⌘⇧B / ⌘, which did not merely fail to record but FIRED — pressing ⌘⇧B into the recorder opened
* the kanban board behind the Settings dialog, and ⌘, re-opened Settings.
*
+ * **KNOWN GAP for the recording half, pre-existing and accepted.** This list was written for the
+ * POLICY stand-down, so it covers only the command-style items that policy needed. The always-on
+ * app roles — `{role:'quit'}` (⌘Q), `{role:'hide'}`/`hideOthers`, `toggleDevTools`,
+ * `togglefullscreen` — are NOT here, so those chords still ACT while a recorder is armed (⌘Q quits
+ * the app). Adding them is refused rather than overlooked: ONE list drives both stand-downs, so
+ * they would also go dead for a terminal-first user with a terminal focused, and quit/hide must
+ * never be policy-gated. Closing it properly means splitting the list per stand-down.
+ *
* mac carries no CLOSE id: the mac template has no `{role:'close'}` at all (Window ▸ Minimize /
* Zoom / Front), which is exactly why `keydownIntercept` is ⌘W's only handler there. Kanban and
* Settings are on BOTH platforms — one `viewSubmenu` array and one `settingsItem` object are shared
diff --git a/src/renderer/components/settings/ShortcutRecorderButton.tsx b/src/renderer/components/settings/ShortcutRecorderButton.tsx
index 97e43dd19..efe5a9c17 100644
--- a/src/renderer/components/settings/ShortcutRecorderButton.tsx
+++ b/src/renderer/components/settings/ShortcutRecorderButton.tsx
@@ -21,10 +21,20 @@
* because the send would be harmless. One global bit, many instances: an unconditional release
* would let a sibling unmounting for unrelated reasons clear the armed recorder's bit.
*
- * **A menu accelerator is still out of reach.** The main-process stand-down only stops nodeterm's
- * own `before-input-event` intercepts; the application menu's accelerators are handled above the
- * page regardless. So ⌘M (Window ▸ Minimize, every platform) and Ctrl+W (Windows/Linux) cannot be
- * recorded here — see the limitation note in `src/main/keydown-intercept.ts`.
+ * **A menu accelerator needs a THIRD mechanism, and it now has one.** The main-process bit above
+ * only stops nodeterm's own `before-input-event` intercepts; the application menu's accelerators
+ * are handled above the page regardless. So main also DISABLES the command-style menu items in
+ * `menuItemIdsToSuspend` while this bit is set (`menuStandsDown` → `syncMenuForStandDown` in
+ * `src/main/index.ts`) — a disabled item suppresses its accelerator, which is what lets ⌘M
+ * (Window ▸ Minimize), ⌘⇧B (Toggle Kanban Board), ⌘, (Settings) and, off-mac, Ctrl+W (Window ▸
+ * Close) reach this component instead of acting. Pressing ⌘⇧B or ⌘, into an armed recorder used to
+ * FIRE — opening the board behind the Settings dialog, or re-opening Settings.
+ *
+ * **What stays out of reach**, deliberately: **Reload** (⌘R / ⌘⇧R) is excluded from that list as
+ * the crash-recovery lever, so it can never be recorded. And the list only covers the items the
+ * policy stand-down needed — the always-on app roles (`quit` ⌘Q, `hide`/`hideOthers`,
+ * `toggleDevTools`, `togglefullscreen`) are NOT suspended, so those chords still act while a
+ * recorder is armed. See `menuItemIdsToSuspend` in `src/main/keydown-intercept.ts`.
*/
import { useCallback, useEffect, useRef, useState } from 'react'
import { COMMANDS_BY_ID, normalizeBindingForCommand, type CommandId } from '@shared/keybindings'