Conversation
handleTermData drops xterm.js replies until initTerminal has loaded the initial terminal data, but the "initial resize" resync started the shell before that. fish sends a Primary Device Attribute (DA1) query at startup, never got the reply, and waited 10s before printing a warning on every new tab. Hold resync requests made before loading finishes and run the latest one once the terminal is loaded. Fixes wavetermdev#3162 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. Walkthrough
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The deferred resynchronization change has no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Fixes #3162
Problem
With fish as the shell, every new terminal tab printed
could not read response to Primary Device Attribute queryafter a 10-second delay. fish sends a DA1 query at startup and waits for the terminal's reply.Root cause
TermWrap.handleTermDatadrops xterm.js replies whileloadedis false. The shell is started byresyncController("initial resize"), which can run beforeinitTerminal()finishes loading the initial terminal data, so fish's DA1 reply is discarded and fish waits out its timeout. It is a race, so it depends on timing.Fix
A resync requested before the terminal is loaded is held in
pendingResyncReasonand run once loading completes.Testing
Linux, fish 4.9.3, local dev build:
Repro
Set fish as the shell and open a new tab; the warning appears after about 10 seconds.
Alternatives considered
initTerminal()fixes the same tests but missesTermResyncHandler, which fires on SSH/WSL connection changes, and can start the shell before the element is sized.heldDatadoes not fix it; the replies are dropped, not buffered.