Repository navigation
Conversation
📝 WalkthroughWalkthroughThe terminal shortcut resolver now maps Ctrl+Enter to a kitty CSI-u sequence by returning a 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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 |
Jinwoo-H
left a comment
There was a problem hiding this comment.
Thanks, this is a good targeted compatibility fix for #5966.
I verified the terminal shortcut path and added an Electron e2e assertion so Ctrl+Enter is covered through the real keydown-to-PTY write path. The implementation is consistent with Orca's existing Shift+Enter terminal shim and keeps other modified Enter chords falling through.
Validation:
- terminal shortcut unit test passed
- lint and typecheck passed
- Electron terminal shortcut e2e passed
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: bc4145af-9956-4112-96c7-1c700ab6d4b5
📒 Files selected for processing (3)
src/renderer/src/components/terminal-pane/terminal-shortcut-policy.test.tssrc/renderer/src/components/terminal-pane/terminal-shortcut-policy.tstests/e2e/terminal-shortcuts.spec.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/renderer/src/components/terminal-pane/terminal-shortcut-policy.test.ts
- src/renderer/src/components/terminal-pane/terminal-shortcut-policy.ts
| await installMainProcessPtyWriteSpy(electronApp) | ||
| await waitForActivePanePtyId(orcaPage) | ||
|
|
||
| await pressAndExpectWrite(orcaPage, electronApp, 'Control+Enter', '\x1b[13;5u') |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert against the active pane PTY, not any PTY write.
Line 503 fetches the active PTY id but drops it, and pressAndExpectWrite only checks for a matching payload. That means this test still passes if \x1b[13;5u is written to the wrong PTY/tab. Please thread the returned ptyId into the assertion and match the { id, data } pair so the regression coverage actually proves routing to the active terminal pane.
Fixes #5966.
Summary
Inside an Orca embedded terminal, Control+Enter was delivered to TUIs as a bare
\r(plain Enter) instead of the distinct Ctrl+Enter chord. Programs that probe the kitty keyboard handshake (CSI ? u) — e.g. the Factory Droid CLI, which uses Ctrl+Enter to cue/queue a message rather than send it — therefore behaved as if the user pressed Enter. The same Droid build works in macOS Terminal / iTerm2.Root cause
Orca advertises kitty keyboard support and the renderer's capture-phase listener (
keyboard-handlers.ts) already forwards Shift+Enter as\x1b[13;2uviasendInput. Ctrl+Enter had no sibling branch, so it fell through to xterm, which collapses it to bare CR.Change
terminal-shortcut-policy.ts— added a sibling branch that intercepts Ctrl+Enter (no other modifiers) and forwards the kitty CSI-u\x1b[13;5u(modifier code 5 = Ctrl) directly to the PTY. No Windows fallback yet; unlike #2418's Codex-on-PowerShell inertness for Shift+Enter, no Windows TUI is known to drop the CSI-u form for Ctrl+Enter.Tests
terminal-shortcut-policy.test.ts— covers macOS/Linux/Windows all emitting\x1b[13;5u, plus regression guards for Ctrl+Shift+Enter and Ctrl+Cmd+Enter.Verification
pnpm devagainst the Droid CLI: Ctrl+Enter cues instead of sending.