Repository navigation
fix(renderer): answer OSC color queries from active terminal theme - #6502
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthrough
🚥 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/terminal-pane/terminal-capability-replies.ts (1)
142-168: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument why replayed OSC color queries are consumed.
The
isReplaying()early returns are non-obvious behavior, just like the DA1 branch above. Please add a shortWhy:comment here too so this doesn't get “simplified” later and reintroduce reply leakage into a fresh shell.As per coding guidelines, “When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 3a0c191e-1e27-4546-b0b8-42d73434eb8f
📒 Files selected for processing (2)
src/renderer/src/components/terminal-pane/terminal-capability-replies.test.tssrc/renderer/src/components/terminal-pane/terminal-capability-replies.ts
Jinwoo-H
left a comment
There was a problem hiding this comment.
Thanks for the targeted fix. I added coverage for the renderer OSC 10/11 path:
- accepts active theme foreground/background replies, including rgba/rgb forms
- keeps replay suppression for restored terminal bytes
- verifies in Electron that injected OSC color queries write replies back to the active PTY
Local validation passed: typecheck, lint, focused unit test, and focused Electron E2E.
- reply to OSC 10/11 foreground/background queries using the resolved xterm theme - suppress replayed OSC color replies to avoid leaking escape output into fresh shells - cover theme-derived color replies and replay suppression with focused tests
Co-authored-by: Orca <[email protected]>
|
thanks for reporting. looking into it |
…tablyai#6502) * fix(renderer): answer OSC color queries from active terminal theme - reply to OSC 10/11 foreground/background queries using the resolved xterm theme - suppress replayed OSC color replies to avoid leaking escape output into fresh shells - cover theme-derived color replies and replay suppression with focused tests * test(renderer): cover terminal OSC color query replies Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Jinwoo-H <[email protected]> Co-authored-by: Orca <[email protected]>
Summary
Codex TUI color detection now receives Orca's active terminal foreground/background colors for OSC 10/11 queries. This prevents Codex from falling back to an incorrect/default dark background for the input area when Orca is using a light terminal theme on Windows.
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildRan:
.\node_modules\.bin\vitest.cmd run src/renderer/src/components/terminal-pane/terminal-capability-replies.test.ts.\node_modules\.bin\oxlint.cmd src/renderer/src/components/terminal-pane/terminal-capability-replies.ts src/renderer/src/components/terminal-pane/terminal-capability-replies.test.tsAI Review Report
Reviewed the terminal color-query path used by TUIs such as Codex. The fix keeps the change scoped to Orca's existing terminal capability reply handler, answers only OSC 10/11 foreground/background queries, and preserves replay suppression so restored scrollback cannot leak terminal replies into a fresh shell.
Cross-platform review: this does not add platform-specific shortcuts, labels, paths, shell assumptions, or Electron platform branches. The behavior is renderer/xterm based and applies consistently across macOS, Linux, Windows, local terminals, and SSH/remote panes.
Security Audit
Reviewed input handling around terminal escape sequences. The handler only responds to exact OSC color queries (
?) and only sends theme-derived color replies back through the existing PTY input path. It does not introduce command execution, filesystem/path handling, dependency changes, auth/secrets handling, or new IPC surfaces.Notes
This is targeted at the Codex input background issue reported on Windows light theme, but the fix is provider-neutral for TUIs that query terminal foreground/background colors through OSC 10/11. Fixes #6091.