Fix Windows ConPTY OSC color reply leak#6975
Conversation
Co-authored-by: Orca <help@stably.ai>
|
Ready to review this PR? Stage has broken it down into 4 individual chapters for you: Chapters generated by Stage for commit 3991e00 on Jul 1, 2026 4:46am UTC. |
📝 WalkthroughWalkthroughThis change adds OSC color query reply gating for terminal panes. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: Pro
Run ID: cc4221d8-45e1-4b6c-9065-491c166dd548
📒 Files selected for processing (4)
src/renderer/src/components/terminal-pane/pty-connection.test.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/components/terminal-pane/terminal-capability-replies.test.tssrc/renderer/src/components/terminal-pane/terminal-capability-replies.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/components/terminal-pane/terminal-capability-replies.ts
| const isSshWindowsConpty = | ||
| runtimeEnvironmentId === null && sshRemotePlatform === 'win32' && !isWslShellName(shellOverride) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Base SSH ConPTY gating on effectiveWindowsShellOverride.
Line 2115 still checks shellOverride, so Windows SSH panes that enter WSL via inherited/default shell settings are classified as ConPTY and stop answering OSC 10/11 queries. That regresses the new WSL-safe path this block just computed.
Suggested fix
const isSshWindowsConpty =
- runtimeEnvironmentId === null && sshRemotePlatform === 'win32' && !isWslShellName(shellOverride)
+ runtimeEnvironmentId === null &&
+ sshRemotePlatform === 'win32' &&
+ !isWslShellName(effectiveWindowsShellOverride)📝 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.
| const isSshWindowsConpty = | |
| runtimeEnvironmentId === null && sshRemotePlatform === 'win32' && !isWslShellName(shellOverride) | |
| const isSshWindowsConpty = | |
| runtimeEnvironmentId === null && | |
| sshRemotePlatform === 'win32' && | |
| !isWslShellName(effectiveWindowsShellOverride) |
Summary\n- suppress OSC 10/11 color-query replies for local native Windows ConPTY panes\n- keep OSC color replies enabled for POSIX-like paths such as WSL, SSH, and remote runtimes\n- add regression coverage for startup spawn metadata and hidden Codex startup output on Windows ConPTY\n\n## Root Cause\nThe startup color-query work added replies that are written back as PTY input. Native Windows ConPTY can treat those bytes like keyboard input, swallowing ESC and echoing the printable remainder into Codex's prompt (for example,
]10;rgb:...).\n\n## Tests\n- pnpm test src/renderer/src/components/terminal-pane/pty-connection.test.ts\n- pnpm test src/renderer/src/components/terminal-pane/terminal-capability-replies.test.ts\n- pnpm run typecheck:webMade with Orca 🐋