Repository navigation
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughShift+Enter handling now sends the CSI-u sequence only when the pane supports it through Windows ConPTY or active Kitty keyboard reporting. Otherwise, it sends 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
2 of 5 tasks
nwparker
deleted the
nwparker/bug-grok-terminal-shows-literal-13-2u-shift-ente
branch
July 12, 2026 22:10
8 tasks done
OrcaWin
added a commit
to OrcaWin/orca
that referenced
this pull request
Jul 16, 2026
… Bash) (stablyai#7620) Shift+Enter still submitted instead of inserting a newline when Droid ran in Git Bash on Windows, even after the PowerShell fix (stablyai#7620/stablyai#8065/stablyai#8427). On Windows, Orca sends Droid the kitty CSI-u byte (ESC [ 13;2u) for Shift+Enter only when the active pane has fresh, trusted process evidence that Droid is the foreground app; otherwise it falls back to the Codex-compatible ESC+CR, which Droid decodes as a plain Enter and submits. That trusted evidence comes from a confirming foreground read. PowerShell triggers that read from its OSC 133 command-start event. Git Bash (and cmd.exe) emit no OSC command boundary, and an Orca-launched agent delivers its command programmatically (no typed-command inference), so a fresh Droid spawn in those shells never earned routing trust -- leaving Shift+Enter on the ESC+CR fallback forever. Fix: on a fresh spawn into a no-OSC shell, seed the SAME command-start confirmation the manually-typed launch path already uses (paneForegroundAgentTracker.onCommandStarted). Its bounded retry ladder spans Droid boot, and -- crucially -- a miss publishes shellForeground:false, so the pane stays recoverable by later focus/reveal samples. (A visible-pty sample was rejected here: on a pathologically slow boot its known-agent shell-confirm would latch, clear launch identity, and permanently poison Shift+Enter for the rest of the session.) A real OSC 133;C, if it arrives, simply supersedes this. Verified on Windows 11 + Git Bash with the real Droid CLI and node-pty ConPTY: - Droid's TUI treats ESC [ 13;2u as a newline (two-line composer) and ESC+CR as a submit -- exactly the reported bug and the fix's mechanism. - droid.exe is a descendant of bash inside the ConPTY console process list (so the main-side scan resolves it) and becomes a live process ~0.8s after launch, well within the retry ladder. Tests: regression test drives the real connectPanePty spawn path and asserts csi-u; a slow-boot test exercises the shell->droid ladder transition; a recoverability test proves a total-miss does NOT poison the pane (it fails against the visible-pty approach and passes with onCommandStarted).
OrcaWin
added a commit
that referenced
this pull request
Jul 16, 2026
… Bash) (#7620) (#8948) Shift+Enter still submitted instead of inserting a newline when Droid ran in Git Bash on Windows, even after the PowerShell fix (#7620/#8065/#8427). On Windows, Orca sends Droid the kitty CSI-u byte (ESC [ 13;2u) for Shift+Enter only when the active pane has fresh, trusted process evidence that Droid is the foreground app; otherwise it falls back to the Codex-compatible ESC+CR, which Droid decodes as a plain Enter and submits. That trusted evidence comes from a confirming foreground read. PowerShell triggers that read from its OSC 133 command-start event. Git Bash (and cmd.exe) emit no OSC command boundary, and an Orca-launched agent delivers its command programmatically (no typed-command inference), so a fresh Droid spawn in those shells never earned routing trust -- leaving Shift+Enter on the ESC+CR fallback forever. Fix: on a fresh spawn into a no-OSC shell, seed the SAME command-start confirmation the manually-typed launch path already uses (paneForegroundAgentTracker.onCommandStarted). Its bounded retry ladder spans Droid boot, and -- crucially -- a miss publishes shellForeground:false, so the pane stays recoverable by later focus/reveal samples. (A visible-pty sample was rejected here: on a pathologically slow boot its known-agent shell-confirm would latch, clear launch identity, and permanently poison Shift+Enter for the rest of the session.) A real OSC 133;C, if it arrives, simply supersedes this. Verified on Windows 11 + Git Bash with the real Droid CLI and node-pty ConPTY: - Droid's TUI treats ESC [ 13;2u as a newline (two-line composer) and ESC+CR as a submit -- exactly the reported bug and the fix's mechanism. - droid.exe is a descendant of bash inside the ConPTY console process list (so the main-side scan resolves it) and becomes a live process ~0.8s after launch, well within the retry ladder. Tests: regression test drives the real connectPanePty spawn path and asserts csi-u; a slow-boot test exercises the shell->droid ladder transition; a recoverability test proves a total-miss does NOT poison the pane (it fails against the visible-pty approach and passes with onCommandStarted).
6 tasks
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
… Bash) (stablyai#7620) (stablyai#8948) Shift+Enter still submitted instead of inserting a newline when Droid ran in Git Bash on Windows, even after the PowerShell fix (stablyai#7620/stablyai#8065/stablyai#8427). On Windows, Orca sends Droid the kitty CSI-u byte (ESC [ 13;2u) for Shift+Enter only when the active pane has fresh, trusted process evidence that Droid is the foreground app; otherwise it falls back to the Codex-compatible ESC+CR, which Droid decodes as a plain Enter and submits. That trusted evidence comes from a confirming foreground read. PowerShell triggers that read from its OSC 133 command-start event. Git Bash (and cmd.exe) emit no OSC command boundary, and an Orca-launched agent delivers its command programmatically (no typed-command inference), so a fresh Droid spawn in those shells never earned routing trust -- leaving Shift+Enter on the ESC+CR fallback forever. Fix: on a fresh spawn into a no-OSC shell, seed the SAME command-start confirmation the manually-typed launch path already uses (paneForegroundAgentTracker.onCommandStarted). Its bounded retry ladder spans Droid boot, and -- crucially -- a miss publishes shellForeground:false, so the pane stays recoverable by later focus/reveal samples. (A visible-pty sample was rejected here: on a pathologically slow boot its known-agent shell-confirm would latch, clear launch identity, and permanently poison Shift+Enter for the rest of the session.) A real OSC 133;C, if it arrives, simply supersedes this. Verified on Windows 11 + Git Bash with the real Droid CLI and node-pty ConPTY: - Droid's TUI treats ESC [ 13;2u as a newline (two-line composer) and ESC+CR as a submit -- exactly the reported bug and the fix's mechanism. - droid.exe is a descendant of bash inside the ConPTY console process list (so the main-side scan resolves it) and becomes a live process ~0.8s after launch, well within the retry ladder. Tests: regression test drives the real connectPanePty spawn path and asserts csi-u; a slow-boot test exercises the shell->droid ladder transition; a recoverability test proves a total-miss does NOT poison the pane (it fails against the visible-pty approach and passes with onCommandStarted).
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.
Description
Fixes the literal
[13;2uShift+Enter leak without broadening terminal byte routing.ESC [ 13 ; 2 u) only while the pane's application has active Kitty keyboard flags.Esc+CRfallback.Closes #8385.
Evidence
Real Grok CLI
Tested the installed
grok 0.2.93 (f00f96316d4b)in a real PTY:PRE+ CSI-u Shift+Enter +POSTrendered as two composer lines.Esc+CR+ALTalso rendered a new composer line, confirming the safe fallback preserves Grok multiline input.Electron / PTY end to end
pnpm run test:e2e -- tests/e2e/terminal-shortcuts.spec.ts --workers=1Esc+CRCSI > 1 uactivation → CSI-u Shift+EnterEsc+CRAutomated checks
pnpm test: 2,721 files passed; 28,730 tests passed; 8 files / 40 tests skipped.pnpm run typecheck: passed.pnpm run lint: passed (pre-existing unrelated warnings only).pnpm exec oxfmt --check ...: passed.--mode e2ebuild: passed.ELI5
CSI-u is like speaking a special keyboard language. Orca used to say “Shift+Enter” in that language even when the program had not said it understood it, so the program could print part of the instruction as
[13;2u. Orca now checks the live “I understand Kitty keyboard” flag first. If it is absent, Orca uses the older safe newline chord instead.Trade-offs
Esc+CRfor Shift+Enter. That is intentional protocol hygiene; the real Grok version was verified to treat the fallback as a newline.[13;2ubug and fix(terminal): stop leaking Shift+Enter CSI-u without Kitty handshake #8386's proposed gate would regress the installed Grok build to plain Enter because it does not publish active flags.Review of #8386
Kept the core insight: live Kitty state should gate off-Windows Shift+Enter CSI-u. Reworked the patch on current
mainand omitted two risky additions:Security
No new IPC, filesystem, network, dependency, authentication, or secret surface. The change only selects between two existing key encodings for an already-open PTY.