Repository navigation
fix(desktop): ensure terminal scrolls to bottom after restore and resize - #864
Conversation
Use xterm.write() callback and requestAnimationFrame to scroll to bottom only after content is fully rendered. This fixes a race condition where the terminal viewport could remain scrolled up after cold restore, hot restore, or visibility/resize changes.
📝 WalkthroughWalkthroughThis PR adds scheduled scroll-to-bottom behavior to the terminal component across multiple restoration and rendering paths. It introduces helpers using requestAnimationFrame to scroll to the bottom after writing scrollback, resizing, visibility changes, and restoration, ensuring the view updates correctly after layout changes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
xterm.write()callback withrequestAnimationFrameto scroll to bottom only after content is fully renderedTest plan
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.