From f01cecdc6046fdecefc948ab20953193ca7e5ea1 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sun, 25 Oct 2026 01:23:51 -0700 Subject: [PATCH] fix(terminal): send Ctrl+Enter as CSI-u to Claude Code on local Windows ConPTY (#33473) Ctrl+Enter reaches Claude Code as CSI-u (`\x1b[13;5u`) on local Windows ConPTY panes, matching macOS/Linux, so custom ctrl+enter keybindings work. Fixes #29711 --- .../components/terminal-pane/terminal-ctrl-enter.test.ts | 2 +- src/shared/tui-agent-config.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/components/terminal-pane/terminal-ctrl-enter.test.ts b/src/renderer/src/components/terminal-pane/terminal-ctrl-enter.test.ts index 4cb4b9a1b52..94c277436cf 100644 --- a/src/renderer/src/components/terminal-pane/terminal-ctrl-enter.test.ts +++ b/src/renderer/src/components/terminal-pane/terminal-ctrl-enter.test.ts @@ -41,7 +41,7 @@ describe('hasCtrlEnterCsiUAuthorityForPane', () => { ) it('authorizes only trusted Ctrl+Enter CSI-u consumers', () => { - for (const agent of ['droid', 'grok', 'opencode'] as const) { + for (const agent of ['claude', 'droid', 'grok', 'opencode'] as const) { expect( hasCtrlEnterCsiUAuthorityForPane( { diff --git a/src/shared/tui-agent-config.ts b/src/shared/tui-agent-config.ts index a9cb6910aef..22667980e5b 100644 --- a/src/shared/tui-agent-config.ts +++ b/src/shared/tui-agent-config.ts @@ -28,7 +28,9 @@ const TUI_AGENT_CONFIG_SOURCE: Record = { preflightTrust: 'claude', // Why: CLAUDE_CODE_DISABLE_TERMINAL_TITLE drops the `✳` title tui-idle waits on (#22655). draftPasteReadySignal: 'claude-composer-prompt', - workerStartReadsComposerMarker: true + workerStartReadsComposerMarker: true, + // Why: Claude decodes CSI-u Ctrl+Enter on local ConPTY; CR made a remapped ctrl+enter act as Enter (#29711). + ctrlEnterEncoding: 'csi-u' }, 'claude-agent-teams': { // Why: an Orca-provided launch mode, not a separate binary; detection follows the Orca CLI. @@ -48,7 +50,9 @@ const TUI_AGENT_CONFIG_SOURCE: Record = { pasteNeedsTypedRequest: true, preflightTrust: 'claude', draftPasteReadySignal: 'claude-composer-prompt', - workerStartReadsComposerMarker: true + workerStartReadsComposerMarker: true, + // Why: runs the same Claude binary, so Ctrl+Enter must match `claude`. + ctrlEnterEncoding: 'csi-u' }, codebuddy: { detectCmd: 'codebuddy',