Repository navigation
fix(terminal): send Ctrl+Enter as CSI-u to Claude Code on Windows ConPTY - #33473
Conversation
…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
|
No actionable comments were generated in the recent review.
|
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.tssends Ctrl+Enter asCSI 13;5uonly when the pane's agent setsctrlEnterEncoding: 'csi-u'inTUI_AGENT_CONFIG(terminal-ctrl-enter.ts). Otherwise it sends\r. Theclaudeentry didn't set it. Claude Code bindsctrl+enteritself: its default Chat binding is"ctrl+enter":"chat:sendNow"next toenter:"chat:submit"(Claude Code 2.1.310 bundled keybinding table,context:"Chat"). Users can remap it inkeybindings.json.What changed
ctrlEnterEncoding: 'csi-u'toclaudeandclaude-agent-teams. Agent Teams runs the same binary; today it's unsupported on win32, so that line only keeps the two entries consistent.claudeto 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 comparedorigin/mainagainst this branch:keybindings.json:enter→chat:newline,ctrl+enter→chat:submit. Typed text, Enter, more text, then Ctrl+Enter\r, Claude inserts a newline, and the prompt can't be submitted\x1b[13;5u, and Claude submits the 2-line prompt\r, which submits\x1b[13;5u, decoded asctrl+enter(chat:sendNow), which submits. No literal[13;5ureaches the composerpnpm tcpasses.pnpm testoversrc/renderer/src/components/terminal-pane,dashboard-popoutandsrc/sharedpasses (22089 tests).check:code-quality:changedpasses.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:sendNowinstead 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)