Skip to content

fix(terminal): send Ctrl+Enter as CSI-u to Claude Code on Windows ConPTY - #33473

Merged
nwparker merged 1 commit into
mainfrom
nwparker/agint-ctrl-enter-claude
Oct 25, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/agint-ctrl-enter-claude

Conversation

@nwparker

@nwparker nwparker commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 0
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4

ELI5

On Windows, Orca used to send Ctrl+Enter to Claude Code as a plain Enter, so Claude couldn't tell the two keys apart. If you set Enter = newline and Ctrl+Enter = submit (the Slack/Teams style), you could never send a prompt. Orca now sends Claude the real Ctrl+Enter key code, which it already does for Droid, Grok and OpenCode.

Root cause

On a local ConPTY pane, terminal-shortcut-policy.ts sends Ctrl+Enter as CSI 13;5u only when the pane's agent sets ctrlEnterEncoding: 'csi-u' in TUI_AGENT_CONFIG (terminal-ctrl-enter.ts). Otherwise it sends \r. The claude entry didn't set it. Claude Code binds ctrl+enter itself: its default Chat binding is "ctrl+enter":"chat:sendNow" next to enter:"chat:submit" (Claude Code 2.1.310 bundled keybinding table, context:"Chat"). Users can remap it in keybindings.json.

What changed

  • Added ctrlEnterEncoding: 'csi-u' to claude and claude-agent-teams. Agent Teams runs the same binary; today it's unsupported on win32, so that line only keeps the two entries consistent.
  • Added claude to the existing authority test list.

This works the same way OpenCode got it in #33149. macOS, Linux, SSH and WSL panes already send CSI-u for Ctrl+Enter, so nothing changes there. Windows Claude panes now behave like they do on those platforms.

Verification (real Windows 11 host, hidden Electron e2e, real Claude Code 2.1.309)

Claude ran with an isolated CLAUDE_CONFIG_DIR. It was deliberately left unauthenticated, so a submit shows "Not logged in". That proves the submit happened without any model spend. I compared origin/main against this branch:

Scenario main this PR
keybindings.json: enter→chat:newline, ctrl+enter→chat:submit. Typed text, Enter, more text, then Ctrl+Enter Orca writes \r, Claude inserts a newline, and the prompt can't be submitted Orca writes \x1b[13;5u, and Claude submits the 2-line prompt
Default keybindings, typed text, Ctrl+Enter \r, which submits \x1b[13;5u, decoded as ctrl+enter (chat:sendNow), which submits. No literal [13;5u reaches the composer

pnpm tc passes. pnpm test over src/renderer/src/components/terminal-pane, dashboard-popout and src/shared passes (22089 tests). check:code-quality:changed passes.

Risk

Low. The change only affects local Windows ConPTY panes whose foreground agent is Claude. With default keybindings, Ctrl+Enter now triggers Claude's own chat:sendNow instead of acting like Enter. That's how Ctrl+Enter already behaves for Claude on macOS and Linux.

Fixes #29711

Visual proof (custom keybindings, after pressing Ctrl+Enter)

main: Ctrl+Enter inserts a newline this PR: Ctrl+Enter submits
main fix

…ws ConPTY

Claude Code decodes CSI-u Ctrl+Enter without kitty negotiation, so a
remapped ctrl+enter (e.g. chat:submit with enter as chat:newline) now
works on Windows instead of arriving as a plain CR.

Fixes #29711
@coderabbitai

coderabbitai Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3547e2d0-0ee0-4f55-9c01-f997e60d6817
Commits

Reviewing files that changed from the base of the PR and between 1e221ce and 1539ddf.

Files selected for processing: 2
  • src/renderer/src/components/terminal-pane/terminal-ctrl-enter.test.ts
  • src/shared/tui-agent-config.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

The Claude and Claude Agent Teams configurations now set ctrlEnterEncoding to csi-u. The trusted Ctrl+Enter consumer test now includes Claude among the agents authorized when routing is trusted and the shell is not foreground.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 1539d

No actionable merge-blocking risk remains from this change.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: sending Ctrl+Enter as CSI-u to Claude Code on Windows ConPTY.
Description check Passed The description explains the user impact, root cause, implementation, scope, linked issue, visual proof, and verification results. It does not reproduce every template heading or checklist item, but t…
Linked Issues check Passed Issue [#29711] requires CSI-u (ESC[13;5u) for Ctrl+Enter in Claude Code on local Windows ConPTY panes. The reviewed head sets ctrlEnterEncoding: 'csi-u' for claude. It also sets the same value f…
Out of Scope Changes check Passed The changes are limited to the TUI agent configuration and its CSI-u authority test. The claude-agent-teams setting supports the same Claude binary and has no current Windows effect because that run…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Full details: Description check

Explanation

The description explains the user impact, root cause, implementation, scope, linked issue, visual proof, and verification results. It does not reproduce every template heading or checklist item, but the required information is substantially covered.

Full details: Linked Issues check

Explanation

Issue [#29711] requires CSI-u (ESC[13;5u) for Ctrl+Enter in Claude Code on local Windows ConPTY panes. The reviewed head sets ctrlEnterEncoding: 'csi-u' for claude. It also sets the same value for claude-agent-teams, which uses the Claude binary. The authority test includes claude among trusted CSI-u consumers. The supplied verification reports the required custom-keybinding and default-keybinding behavior on Windows, plus passing automated checks.

Full details: Out of Scope Changes check

Explanation

The changes are limited to the TUI agent configuration and its CSI-u authority test. The claude-agent-teams setting supports the same Claude binary and has no current Windows effect because that runtime is unsupported. The test change verifies the new Claude routing behavior. No unrelated production behavior is shown.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit f01cecd into main Oct 25, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Send Ctrl+Enter as CSI-u to Claude Code on Windows ConPTY

1 participant