Repository navigation
Fix Codex Shift+Enter on Windows - #2418
Merged
Jinwoo-H merged 1 commit intoMay 20, 2026
Merged
Conversation
Contributor
Author
|
Additional Windows e2e evidence after opening the PR:
The temporary spec was removed after the verification so it does not affect the PR diff. |
Jinwoo-H
deleted the
Jinwoo-H/bug-shift-enter-does-nothing-in-codex-inside-win
branch
May 20, 2026 08:06
nwparker
added a commit
that referenced
this pull request
Jul 11, 2026
) * fix(terminal): send CSI-u Shift+Enter to kitty TUIs (droid) on Windows (#7620) On Windows, Shift+Enter was always sent as the Alt+Enter byte ESC+CR (added in #2418 for Codex, which reads win32-input-mode and ignores CSI-u). droid speaks the kitty keyboard protocol, parses CSI-u directly, and treats ESC+CR as a plain Enter — so Shift+Enter SUBMITTED the message instead of inserting a newline. droid works in other terminals (Windows Terminal, Warp) because those honor win32-input-mode / kitty; Orca (xterm.js) withholds kitty from local Windows ConPTY panes and emits neither. Make the Windows Shift+Enter byte pane-aware: latch whether a pane's program advertised the kitty keyboard protocol (query CSI ? u, push CSI > .. u, or set CSI = .. u) and send CSI-u (\x1b[13;2u) to those panes, keeping the Codex-compatible ESC+CR for win32-input-mode-only TUIs. Non-Windows is unchanged (always CSI-u). Verified end-to-end against the real droid and Codex CLIs through the actual production functions: droid now newlines, Codex still newlines. * fix(terminal): route Windows Shift+Enter safely for Droid --------- Co-authored-by: Neil <[email protected]> Co-authored-by: Neil <[email protected]>
This was referenced Jul 22, 2026
This was referenced Aug 3, 2026
2 of 5 tasks
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
) (stablyai#7668) * fix(terminal): send CSI-u Shift+Enter to kitty TUIs (droid) on Windows (stablyai#7620) On Windows, Shift+Enter was always sent as the Alt+Enter byte ESC+CR (added in stablyai#2418 for Codex, which reads win32-input-mode and ignores CSI-u). droid speaks the kitty keyboard protocol, parses CSI-u directly, and treats ESC+CR as a plain Enter — so Shift+Enter SUBMITTED the message instead of inserting a newline. droid works in other terminals (Windows Terminal, Warp) because those honor win32-input-mode / kitty; Orca (xterm.js) withholds kitty from local Windows ConPTY panes and emits neither. Make the Windows Shift+Enter byte pane-aware: latch whether a pane's program advertised the kitty keyboard protocol (query CSI ? u, push CSI > .. u, or set CSI = .. u) and send CSI-u (\x1b[13;2u) to those panes, keeping the Codex-compatible ESC+CR for win32-input-mode-only TUIs. Non-Windows is unchanged (always CSI-u). Verified end-to-end against the real droid and Codex CLIs through the actual production functions: droid now newlines, Codex still newlines. * fix(terminal): route Windows Shift+Enter safely for Droid --------- Co-authored-by: Neil <[email protected]> Co-authored-by: Neil <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2412.
On Windows, Orca now sends
Esc+Enter(\x1b\r) for bareShift+Enterin terminal panes instead of the CSI-u\x1b[13;2usequence that Codex ignores inside PowerShell. macOS and Linux keep the existing CSI-u behavior.Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildAdditional verification run:
pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/terminal-shortcut-policy.test.ts src/renderer/src/lib/pane-manager/pane-lifecycle.test.tspnpm exec electron-vite build --mode e2eSKIP_BUILD=1 pnpm exec playwright test tests/e2e/terminal-shortcuts.spec.ts --config=tests/playwright.config.ts --project=electron-headless -g "Shift\+Enter writes" --reporter=linepnpm run typecheck:webgit diff --checkcodex-cli 0.132.0under Windows PowerShell: old\x1b[13;2uproducedhelloworld; new\x1b\rrenderedhelloandworldon separate composer lines.Note: the broader
all terminal chords reach the PTY or fire their actionPlaywright spec still closes the Electron page later during pane action checks in this Windows environment. The new focused regression covers the changed Shift+Enter behavior directly.AI Review Report
Reviewed the terminal keyboard routing from the window-level handler through
resolveTerminalShortcutActionto PTY writes. Main risks checked:navigator.userAgent.includes('Windows').\x1b[13;2usequence.Cmd/Ctrl+Shift+Enterpane expand remains separate from bareShift+Enter.Added unit and Playwright coverage for the Windows byte sequence and preserved non-Windows expectations.
Security Audit
No new command execution, auth, filesystem, dependency, IPC channel, or path handling is introduced. The change only alters the string sent to an already-active PTY for a user-initiated terminal key chord. Clipboard/paste handling is unchanged.
Notes
This does not change paste behavior. Normal terminal paste still goes through xterm/bracketed paste. Orca's agent draft paste path may append a plain Enter when explicitly asked to submit after pasting; that is separate from the interactive
Shift+Enterkeybinding fixed here.