Repository navigation
Description
Operating system
Windows
Orca version
v1.4.220
Details
[Bug]: Ctrl+Enter is sent as plain Enter for OpenCode on Windows Local ConPTY
Environment
- Orca 1.4.220
- OpenCode 1.18.34
- Windows Terminal 1.24.2741.0 (Microsoft Store)
- Windows + Nushell
Problem
Ctrl+Enter works correctly with OpenCode in WSL and in Windows Terminal, but becomes a plain Enter when OpenCode runs in Orca's Windows embedded terminal.
I verified this independently of OpenCode with a Node.js raw-input test after explicitly enabling the Kitty keyboard protocol:
Windows Terminal:
Ctrl+Enter → 1b 5b 31 33 3b 35 75 (CSI 13;5u)
Orca:
Ctrl+Enter → 0d (CR)
Therefore the modifier information is lost in Orca before OpenCode receives the input.
Windows Terminal workaround
Windows Terminal does not provide this behavior automatically in my setup. I explicitly configured these actions:
{
"actions": [
{
"command": {
"action": "sendInput",
"input": "\u001b[13;5u"
},
"id": "User.sendInput.CtrlEnterCustom"
},
{
"command": {
"action": "sendInput",
"input": "\u001b[13;2u"
},
"id": "User.sendInput.ShiftEnterCustom"
}
]
}With this configuration, Windows Terminal sends the expected CSI-u sequences to OpenCode.
Reproduction
Using a small Node.js raw-input test program that explicitly enables the Kitty keyboard protocol:
Windows Terminal:
Enter → 0d
Ctrl+Enter → 1b 5b 31 33 3b 35 75
Shift+Enter → 1b 5b 31 33 3b 32 75
Orca:
Enter → 0d
Ctrl+Enter → 0d
Shift+Enter → 1b 0d
This demonstrates that the issue occurs in Orca's terminal input handling rather than in OpenCode's keybinding configuration.
Related issues
This appears related to #12329, #12462, and the earlier Ctrl+Enter handling in #5966 / #6383.
#12329 reported that Orca unconditionally sent CSI-u for Ctrl+Enter on Windows Local ConPTY. #12462 changed this behavior so that ordinary Windows Local ConPTY panes fall back to CR, while CSI-u can still be used for active/trusted TUI panes.
The current behavior appears to leave OpenCode on the CR fallback path, so Ctrl+Enter becomes indistinguishable from Enter.
In Orca 1.4.220, OpenCode is present in tui-agent-config.ts, but does not specify:
ctrlEnterEncoding: 'csi-u'while some other TUI clients do.
Suggested fix
Could Orca provide a way for OpenCode to receive Ctrl+Enter as CSI-u on Windows Local ConPTY?
For example, OpenCode could potentially be treated as a trusted CSI-u consumer, similar to other supported TUI clients, or Orca could provide an explicit terminal shortcut/input mapping that sends:
Ctrl+Enter → ESC [ 13 ; 5 u
I am not suggesting reverting the compatibility behavior introduced by #12462 for unsupported Windows TUIs. The issue is that OpenCode currently cannot receive Ctrl+Enter as a distinct key combination in Orca, while the same OpenCode installation works correctly when the terminal explicitly sends the CSI-u sequence.
Activity
paoValle commentedon Oct 5, 2026
Taking this one — and your diagnosis is right, including the file it points at. Traced the full chain; it also explains the one detail in your report that looked like a second bug.
Why
Ctrl+Enterbecomes CR on local Windows ConPTYsrc/renderer/src/lib/pane-manager/terminal-keyboard-protocol.ts—shouldDisableKittyKeyboardForTerminal()withholdsvtExtensions.kittyKeyboardfrom xterm on a local native Windows ConPTY pane, for every agent exceptgrok(the#2434protection for CSI-u-blind CLIs).src/renderer/src/components/terminal-pane/pty-connection/connect-pane-pty.ts:172builds theTerminalKittyKeyboardModeTrackerwith exactly that option:kittyKeyboard: pane.terminal.options.vtExtensions?.kittyKeyboard === true. With the protocol withheld, the tracker ignoresCSI > uentirely andflagsstays0forever.src/renderer/src/components/terminal-pane/terminal-shortcut-policy.ts:189decides the chord:\x1b[13;5u.terminal-ctrl-enter.tsresolves that authority asTUI_AGENT_CONFIG[agent].ctrlEnterEncoding === 'csi-u'. Today that isdroidandgrokonly. OpenCode is absent →\r.The detail that looked like a second bug
Your Node raw-input test still received
0dafter explicitly enabling the Kitty protocol. That is step 2: because Orca withholds the advertisement on this pane type, its own tracker is constructed to ignore the protocol, so an application-sideCSI > ucannot reach the negotiation route either. There is no second defect — the negotiation route is simply closed on local ConPTY by design, which is whydroidneeded an explicit opt-in instead.What I'll change
Treat OpenCode like Droid, which is the existing precedent for this exact situation: it decodes CSI-u but is not a candidate for re-advertising KKP globally.
src/shared/tui-agent-config.ts:ctrlEnterEncoding: 'csi-u'on theopencodeentry.opencodein the trusted-consumer list interminal-ctrl-enter.test.ts.Not changing the global ConPTY withhold (that is the
#2434protection), and not touching Shift+Enter —Esc+CRis what OpenCode receives today and your report does not list it as broken.Evidence that OpenCode decodes CSI-u, without needing a Windows host: it already works in Orca's WSL pane, where the same policy emits
\x1b[13;5ubecause!localWindowsConptyis false there; and in Windows Terminal with your explicitsendInputaction.One limitation I will record in the PR: the authority is pane-scoped, so this depends on the pane carrying agent evidence (a launch, a process read, or a title that resolves to
opencode), the same condition Droid's and Grok's chord already has. A hand-started OpenCode in a pane whose title identifies nothing will keep falling back to\r.I'll open the PR shortly and link this issue with
Fixes.paoValle commentedon Oct 10, 2026
Housekeeping note on my own claim:
#25505is closed. I had seven small PRs open here at once andthis was the four-line one, so I let it go rather than carry it — the diagnosis in this issue is
unchanged and still actionable (the
0darriving instead of the CSI-u sequence). Say the word andI reopen the PR, or anyone is welcome to take it.
Pr1p commentedon Oct 24, 2026
I’m picking this up with the narrow existing-precedent approach: first I’ll pin the Windows Ctrl+Enter regression in a focused test, then grant OpenCode CSI-u authority without changing the global local-ConPTY safeguard for other terminals.
fix(terminal): preserve OpenCode Ctrl+Enter on Windows (#33149)