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
This commit is contained in:
Neil
2026-10-25 01:23:51 -07:00
committed by GitHub
parent 7d493ea6d1
commit f01cecdc60
2 changed files with 7 additions and 3 deletions
@@ -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(
{
+6 -2
View File
@@ -28,7 +28,9 @@ const TUI_AGENT_CONFIG_SOURCE: Record<TuiAgent, TuiAgentConfigSource> = {
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<TuiAgent, TuiAgentConfigSource> = {
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',