Repository navigation
test(e2e): stabilize terminal shortcut Kitty and Ctrl+C tests - #23472
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — test-only stabilization of tests/e2e/terminal-shortcuts.spec.ts (1 file, +7/−6).
- Kitty
Shift+Entertest — The arming command now stays alive and disarms itself (printf '\033[>1u'; read -r _; printf '\033[<u') instead of the old settledprintf '\033[>1u'plus a separate\x15\x03/printf '\033[=0u'reset; the disarm step sends\rto endread. Assertions (flags1→\x1b[13;2u; flags0→\x1b\r) are unchanged. - Plain
Ctrl+Ctest — Adds a readiness barrier (echo "CTRL_C_""READY"+waitForTerminalOutput('CTRL_C_READY')) before the interrupt. The split-quote marker keeps the echoed command from satisfying the wait. Assertions unchanged.
Both changes keep the same assertions, and getKittyKeyboardFlags reads the xterm coreService.kittyKeyboard.flags state that the Shift+Enter policy itself consumes, so neither test was weakened into theatre. No production code touched.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between e6cccfb27027bce57500e37c417d2bb37b4250e2 and 8e9aceb. You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe Kitty keyboard-state test now releases its read with carriage return and resets reporting flags within the shell command. The Ctrl+C test now waits for a shell ready marker after it captures the active PTY ID. Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to The Ctrl+C end-to-end test may time out on Windows. Use a shell-neutral ready marker before merging. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 428be441-2646-4fe6-a2f9-8a6f473d1fa5
📥 Commits
Reviewing files that changed from the base of the PR and between 838769d and e6cccfb27027bce57500e37c417d2bb37b4250e2.
📒 Files selected for processing (1)
tests/e2e/terminal-shortcuts.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| await waitForActivePanePtyId(orcaPage) | ||
| const ptyId = await waitForActivePanePtyId(orcaPage) | ||
| // SIGINT during shell startup kills the shell, so interrupt only a ready prompt. | ||
| await execInTerminal(orcaPage, ptyId, 'echo "CTRL_C_""READY"') |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
rg -n -C 5 'CTRL_C_READY|execInTerminalImpl|powershell|pwsh|cmd.exe|shellPath|defaultShell' .Repository: stablyai/orca
Length of output: 43452
🏁 Script executed:
set -eu
printf '%s\n' '--- changed file diff ---'
git diff --unified=25 ef987e42d77279aaf28e128159341b787c45645f e6cccfb27027bce57500e37c417d2bb37b4250e2 -- tests/e2e/terminal-shortcuts.spec.ts
printf '%s\n' '--- relevant symbols in changed file ---'
rg -n -C 12 'execInTerminalImpl|execInTerminal|waitForTerminalOutput|CTRL_C_READY|powershell|pwsh|cmd\.exe|shellPath|defaultShell' tests/e2e/terminal-shortcuts.spec.ts
printf '%s\n' '--- helper declarations/usages ---'
rg -n -C 8 'function execInTerminalImpl|const execInTerminalImpl|async function execInTerminalImpl|execInTerminalImpl\s*=|function waitForTerminalOutput|const waitForTerminalOutput|async function waitForTerminalOutput' tests src config --glob '!**/*.json' --glob '!**/*.jsonc'
printf '%s\n' '--- likely Windows terminal shell bindings ---'
rg -n -C 10 'defaultShell|shellPath|PowerShell|powershell\.exe|pwsh\.exe|cmd\.exe|Git Bash|bash\.exe' src/main src/renderer tests config --glob '*.{ts,tsx,js,mjs,json,jsonc}' | head -n 1200Repository: stablyai/orca
Length of output: 41689
🏁 Script executed:
set -eu
git diff --unified=25 ef987e42d77279aaf28e128159341b787c45645f e6cccfb27027bce57500e37c417d2bb37b4250e2 -- tests/e2e/terminal-shortcuts.spec.ts
printf '%s\n' '--- test references ---'
rg -n -C 12 'execInTerminalImpl|execInTerminal|waitForTerminalOutput|CTRL_C_READY|powershell|pwsh|cmd\.exe|shellPath|defaultShell' tests/e2e/terminal-shortcuts.spec.ts
printf '%s\n' '--- helper declarations ---'
rg -n -C 8 'function execInTerminalImpl|const execInTerminalImpl|async function execInTerminalImpl|execInTerminalImpl\s*=|function waitForTerminalOutput|const waitForTerminalOutput|async function waitForTerminalOutput' tests src config --glob '!**/*.json' --glob '!**/*.jsonc'
printf '%s\n' '--- Windows shell bindings ---'
rg -n -C 10 'defaultShell|shellPath|PowerShell|powershell\.exe|pwsh\.exe|cmd\.exe|Git Bash|bash\.exe' src/main src/renderer tests config --glob '*.{ts,tsx,js,mjs,json,jsonc}' | head -n 1200Repository: stablyai/orca
Length of output: 41420
🏁 Script executed:
set -eu
printf '%s\n' '--- execInTerminal bindings ---'
rg -n -C 20 'execInTerminal' tests/e2e --glob '*.{ts,tsx,js,mjs}'
printf '%s\n' '--- terminal helper files ---'
git ls-files 'tests/e2e/helpers/*terminal*' 'tests/e2e/*terminal*'
printf '%s\n' '--- shell selection in E2E fixtures ---'
rg -n -C 12 'defaultShell|shellPath|windows.*shell|PowerShell|pwsh|cmd\.exe|bash\.exe|WINDOWS_.*SHELL|terminalShell' tests/e2e src/main src/renderer/src --glob '*.{ts,tsx,js,mjs}'Repository: stablyai/orca
Length of output: 45668
🏁 Script executed:
set -eu
printf '%s\n' '--- helper files containing execInTerminal ---'
rg -l 'execInTerminal' tests/e2e --glob '*.{ts,tsx,js,mjs}' | sort
printf '%s\n' '--- exact execInTerminal references ---'
rg -n -C 12 'execInTerminal' tests/e2e --glob '*.{ts,tsx,js,mjs}'
printf '%s\n' '--- Windows shell constants and consumers ---'
rg -n -C 12 'WINDOWS_.*SHELL|windows.*shell|defaultShell|shellPath|PowerShell|pwsh|cmd\.exe|bash\.exe' tests/e2e src/main src/renderer/src --glob '*.{ts,tsx,js,mjs}' | grep -E 'tests/e2e|windows-terminal-shell|terminal.*shell|shell.*terminal|defaultShell|shellPath|execInTerminal' | head -n 600Repository: stablyai/orca
Length of output: 45665
🏁 Script executed:
set -eu
rg -l 'execInTerminal' tests/e2e --glob '*.{ts,tsx,js,mjs}' | sort
rg -n -C 12 'execInTerminal' tests/e2e --glob '*.{ts,tsx,js,mjs}'
rg -n -C 12 'WINDOWS_.*SHELL|windows.*shell|defaultShell|shellPath|PowerShell|pwsh|cmd\.exe|bash\.exe' tests/e2e src/main src/renderer/src --glob '*.{ts,tsx,js,mjs}' | grep -E 'tests/e2e|windows-terminal-shell|terminal.*shell|shell.*terminal|defaultShell|shellPath|execInTerminal' | head -n 600Repository: stablyai/orca
Length of output: 45663
🏁 Script executed:
set -eu
printf '%s\n' '--- terminal helper exports and imports ---'
rg -n 'execInTerminal|terminal-pane-operations|createTerminal|terminalWindowsShell|defaultShell|shellPath' tests/e2e/helpers/terminal.ts tests/e2e/helpers/terminal-pane-operations.ts tests/e2e/helpers/orca-app.ts tests/e2e/helpers/*.ts
printf '%s\n' '--- terminal helper source ---'
sed -n '1,260p' tests/e2e/helpers/terminal.ts
printf '%s\n' '--- terminal pane operation source around exec ---'
rg -n -C 25 'execInTerminal|sendToTerminal' tests/e2e/helpers/terminal-pane-operations.tsRepository: stablyai/orca
Length of output: 11709
🏁 Script executed:
set -eu
rg -n 'execInTerminal|terminal-pane-operations|createTerminal|terminalWindowsShell|defaultShell|shellPath' tests/e2e/helpers/terminal.ts tests/e2e/helpers/terminal-pane-operations.ts tests/e2e/helpers/orca-app.ts tests/e2e/helpers/*.ts
sed -n '1,260p' tests/e2e/helpers/terminal.ts
rg -n -C 25 'execInTerminal|sendToTerminal' tests/e2e/helpers/terminal-pane-operations.tsRepository: stablyai/orca
Length of output: 11583
🏁 Script executed:
set -eu
printf '%s\n' '--- terminalWindowsShell declarations and defaults ---'
rg -n -C 8 'terminalWindowsShell' src/shared src/main src/renderer/src tests/e2e --glob '*.{ts,tsx,js,mjs}'
printf '%s\n' '--- Windows shell resolver ---'
rg -n -C 20 'resolveWindowsShell|BuiltInWindowsTerminalShell|WINDOWS_.*SHELL|powershell\.exe.*default|default.*powershell' src/shared src/main src/renderer/src tests/e2e --glob '*.{ts,tsx,js,mjs}'Repository: stablyai/orca
Length of output: 45664
🌐 Web query:
official PowerShell about quoting rules adjacent double-quoted string literals echo "a""b"
💡 Result:
The official rule is that **two consecutive double quotes inside a double-quoted string represent one literal double quote**. So:
```powershell
echo "a""b"
```
outputs:
```text
a"b
```
Here `echo` is an alias for `Write-Output`; this is one string argument, not two adjacent strings being concatenated. Microsoft’s `about_Quoting_Rules` gives the same doubled-quote rule and an example. ([learn.microsoft.com](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?trk=article-ssr-frontend-pulse_little-text-block&view=powershell-5.1&utm_source=openai))
Citations:
- 1: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?trk=article-ssr-frontend-pulse_little-text-block&view=powershell-5.1&utm_source=openai
Use a shell-neutral ready marker.
When the pane uses PowerShell, echo "CTRL_C_""READY" emits CTRL_C_"READY, not CTRL_C_READY. The following wait can therefore time out.
🐛 Suggested fix
- await execInTerminal(orcaPage, ptyId, 'echo "CTRL_C_""READY"')
+ await execInTerminal(orcaPage, ptyId, 'echo CTRL_C_READY')📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| await execInTerminal(orcaPage, ptyId, 'echo "CTRL_C_""READY"') | |
| await execInTerminal(orcaPage, ptyId, 'echo CTRL_C_READY') |
Shift+Enter: the host now grounds keyboard modes a finished command left armed, so the test's one-shot `printf '\033[>1u'` was reset to 0 before the poll. Keep the command alive via `read` while asserting, then let it pop its own flags on Enter. Ctrl+C: each test opens a fresh tab, and SIGINT during shell startup can kill the shell and close the tab. Wait for a ready prompt before interrupting. The existing post-interrupt assertions are unchanged.
e6cccfb to
8e9aceb
Compare

ELI5
Two terminal keyboard tests were unreliable. One always failed, and because the file's tests run in order, that failure hid every test after it. This fixes both tests. No app code changes.
What Changed
printf '\033[>1u'). Since fix(terminal): ground a program that dies with input modes armed on the normal screen #22739, the terminal daemon resets input modes that a finished command leaves on, so the flags were back at 0 before the test could check them. The test now uses a command that stays alive while the test checks the Kitty encoding (printf '\033[>1u'; read -r _; printf '\033[<u'). Pressing Enter then ends the command, which turns the protocol off itself, and the test checks the plain encoding. This replaces the old manual line-clear and reset.echoround-trip) before sending Ctrl+C. Its assertions are unchanged.Why
Linked Issue
N/A (maintainer test fix)
Visual Proof
N/A: tests only; no UI or behavior change.
Testing
On macOS, hidden (
ORCA_BACKGROUND_LAUNCH=1,electron-headless, one worker),tests/e2e/terminal-shortcuts.spec.ts:Linux and Windows are covered by CI.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Test-only change. No effect on security, platform behavior, SSH, mobile, compatibility, or performance.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)