Claude Code. Any Model. The most powerful AI coding agent now speaks every language.
fix(team): force editorMode normal in pane children
Jack Rudenko87d31943fb03
diff --git a/ai-docs/architecture/pane-session.md b/ai-docs/architecture/pane-session.mdindex c1d5a744..8ec873bd 100644--- a/ai-docs/architecture/pane-session.md+++ b/ai-docs/architecture/pane-session.md@@ -135,7 +135,14 @@ accepting one on the user's behalf (trusting a folder, enabling a project's MCPdecision claudish has no standing to make. The bypass-permissions dialog is the one that `-y`itself would cause, so it is suppressed instead: a pane child's `--settings` overlay carries`skipDangerousModePermissionPrompt: true`, gated on `CLAUDISH_PANE_CHILD=1` so no other launch-gets it (D5). The API-key dialog was not recaptured on 2.1.290 (it needs a foreign route with+gets it (D5). The same overlay, on the same marker, carries `editorMode: "normal"`: a user+`editorMode: "vim"` leaves the box in `-- INSERT --`, the submit Enter is swallowed, the typed+prompt sits unsent, and every slot fails `prompt_not_accepted` with anomaly `resent_enter`+(measured 2026-10-16, Claude Code 2.1.301, magmux 0.15.1). Claude Code merges settings per key, so+the user's other settings still apply. Claude Code keeps only the LAST `--settings` flag, so a+caller's `claude_flags --settings` is merged into claudish's temp file (`mergeUserSettingsIfPresent`)+and one `--settings <path>` is emitted; in a pane `editorMode` is forced over the caller's. magmux 0.16.0 forces the same value for its panes; once it+is the minimum, this key can go. The API-key dialog was not recaptured on 2.1.290 (it needs a foreign route with`ANTHROPIC_API_KEY` set); its marker is the verbatim 2.1.287 text.**An unknown `--agent` is refused by the child itself**, which is why the old `claude -p` agentdiff --git a/packages/cli/src/claude-runner.ts b/packages/cli/src/claude-runner.tsindex 4ea8429e..47c34ad9 100644--- a/packages/cli/src/claude-runner.ts+++ b/packages/cli/src/claude-runner.ts@@ -1012,6 +1012,15 @@ export function scrubChildEnv(* one-time confirmation dialog defaults to "No, exit": nobody is at a headless pane to* answer it, so every slot would fail at boot. Verified to suppress the dialog at this* tier. Gated on the marker so no other launch changes.+ * - `editorMode: "normal"` is added ONLY in an MCP pane child, for the same reason+ * and on the same marker. A user `editorMode: "vim"` puts the REPL box in vim+ * INSERT mode, where the Enter claudish sends to submit the typed prompt is+ * swallowed: the prompt sits in the box and the slot fails `prompt_not_accepted`.+ * Interactive use outside a pane keeps the user's editorMode. magmux 0.16.0 forces+ * the same value for its panes; once that is the minimum, this key can go.+ *+ * Claude Code merges settings sources per key, so every other key of the user's+ * settings files still applies; this overlay only wins on the keys it sets.** (The OS *managed* tier can't be overridden — that case aborts before we get here.)*/@@ -1026,6 +1035,7 @@ export function buildClaudishSettingsOverlay(}if (paneChild) {settings.skipDangerousModePermissionPrompt = true;+ settings.editorMode = "normal";}return settings;}@@ -1087,6 +1097,13 @@ export function mergeUserSettingsIfPresent(userSettings.skipDangerousModePermissionPrompt = true;}+ // In an MCP pane child, keep the REPL box out of vim mode so the submit Enter+ // reaches it (see buildClaudishSettingsOverlay). Forced over the caller's+ // --settings: a pane child in vim mode cannot accept a prompt at all.+ if (paneChild) {+ userSettings.editorMode = "normal";+ }+// Overwrite the temp settings file with the merged resultwriteFileSync(tempSettingsPath, JSON.stringify(userSettings, null, 2), "utf-8");} catch {