[Bugfix #205] Fix terminal garbled output and replay scroll#283
Merged
waleedkadous merged 2 commits intomainfrom Feb 15, 2026
Merged
[Bugfix #205] Fix terminal garbled output and replay scroll#283waleedkadous merged 2 commits intomainfrom
waleedkadous merged 2 commits intomainfrom
Conversation
After Tower restart, terminal replay buffer data was rendered but the viewport stayed at line 0 (top of scrollback) instead of scrolling to the bottom. The fix (scrollToBottom after flush + deferred resize) is already in the codebase; this adds the missing regression test covering: - scrollToBottom called after initial buffer flush - Deferred scrollToBottom (350ms) after fitAddon.fit settles - Forced PTY resize sent after replay flush - Handles empty replay buffer gracefully - DA sequence filtering during replay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds regression test for the reopened scroll-to-bottom aspect of issue #205. The code fix (scrollToBottom after replay buffer flush + deferred resize to PTY) was previously applied in bd55422.
Fixes #205
Root Cause
Two related issues:
Garbled output on tab switch (original): Terminal components were unmounted/remounted on every tab switch, triggering WebSocket reconnection and full ring-buffer replay on fresh xterm.js instances.
Viewport stuck at top after replay (reopened): After Tower restart, replay buffer data was rendered but
scrollToBottom()was never called, leaving the viewport at line 0.Fix
Tab persistence (PR [Bugfix #205] Fix terminal garbled output when revisiting tabs #207): Keep Terminal components mounted via CSS
display:noneinstead of unmounting. Track activated terminals to avoid pre-mounting unvisited tabs.Scroll after replay (bd55422): Call
scrollToBottom()in theterm.write()callback after initial buffer flush, plus a deferredscrollToBottom()after 350ms to account forfitAddon.fit()resetting the viewport. Also sends a forced resize to the PTY so the shell redraws at correct dimensions.Test Plan
Terminal.replay-scroll.test.tsx) — 5 test casesApp.terminal-persistence.test.tsx) — 3 test casesCMAP Review
mockFitFn; CI dashboard coverage is pre-existing issue (all 10+ dashboard tests are in the same situation)