Repository navigation
fix(terminal): stop doubled ?997;1n color-scheme reply leaking into fish - #10054
brennanb2025 wants to merge 4 commits into
Conversation
Fixes STA-2385. fish probes color-scheme with two sequences (CSI ?2031h subscribe + CSI ?996n query). Orca answered BOTH with an identical CSI ?997;1n, so the reply doubled and leaked visibly into fish in regular and floating panes. #8206 only retimed the seed, so the double survived. Fix: make the gate-managed mode-2031 subscribe fact record-only (no reply); the ?996n query answer remains the single responder. Test plan: vitest pty-connection + query-responder green; reproduced live on macOS default config before/after.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughUpdated mode-2031 transient-fact handling to emit unsubscribe events from background sessions and represent them in the daemon event model. Renderer subscribe facts now register pane subscriptions without sending immediate CSI 997 replies, with tests covering hidden and visible panes and chunk-split mode sequences. 🚥 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: Pro Plus
Run ID: dc452246-0f3b-4ac4-940f-a7a247f86829
📒 Files selected for processing (2)
src/renderer/src/components/terminal-pane/pty-connection.test.tssrc/renderer/src/components/terminal-pane/pty-connection.ts
Locks STA-2385's repro at the responder layer: a hidden/parked PTY that receives fish's subscribe + query pair must emit exactly one CSI ?997;1n, so neither a re-added subscribe seed nor a lost ?996n answer can regress. Also repairs two comments mangled by the seed removal.
|
@brennanb2025 Coming back to this a year late — you were right, and this sat unmerged for the wrong reason. I fixed #9993 today in #13904 and independently landed on your conclusion: make mode 2031 subscriptions silent. Worth recording why this one probably stalled, since the fix direction was right. The commit message here says:
That premise doesn't hold: fish never sends The actual justification is simpler and checkable: replying to The real doubling, for the record, is xterm's own theme-write report plus Your diff also caught something I initially got wrong. You removed Closing this in favor of #13904, which has the real-fish regression test this needed to be merge-able. Sorry it took this long to come back around — you had it first. |
|
Superseded by #13904, now merged as Closing this properly; my earlier comment said I was closing it and I only left the comment. To restate the credit: you had the right fix here a year ago — silent mode 2031 subscriptions. #13904 landed the same conclusion, reached independently and then confirmed against your commit. What it adds is the justification this needed to be merge-able: the Contour spec's "only send the DSR when the palette has been updated", Ghostty/iTerm2/xterm.js all emitting nothing on the DECSET, and a real-fish node-pty regression test that fails against pre-fix code. |
Fixes STA-2385.
fish 4.7.1 toggles CSI ?2031h and CSI ?2031l around terminal ownership. Per the color-scheme protocol, enabling mode 2031 subscribes to future palette-change notifications; it does not request an immediate CSI ?997...n report. Orca seeded a report on every subscription, sometimes through more than one lifecycle path, so a report could arrive after fish stopped reading terminal responses and render as literal text.
Fix:
Reliability contract:
Validation: