You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Terminal still scrolls to top of buffer (regression from #423) #560
Terminals in the dashboard are still unnecessarily scrolling to the top of their buffers. This was previously reported as #423 and fixed in PR #424, but the bug has regressed.
The fix wrapped fitAddon.fit() with scroll position preservation in safeFit() — saving viewportY before fit, restoring after. Applied to debouncedFit (ResizeObserver/visibilitychange triggers) and handleRefresh. The root cause was fitAddon.fit() → terminal.resize() → buffer reflow resetting the viewport to the top.
Current Behavior
Terminal auto-scrolls to the top of the buffer periodically, requiring manual scroll-down.
Expected Behavior
Terminal should stay scrolled to the bottom (near the input cursor) unless the user explicitly scrolls up. If scrolled up, it should stay at that position.
Investigation Notes
The previous fix covered debouncedFit and handleRefresh code paths. The regression suggests another code path is resetting scroll position — possibly:
Data writes (onData callbacks)
Tab switching / visibility changes not going through safeFit()
WebSocket reconnection replaying buffer
React re-renders causing xterm to reinitialize
Check all code paths that could trigger scroll changes in the terminal component and ensure they all preserve scroll position.
Activity
waleedkadous commentedon Feb 25, 2026
On it! Working on a fix now.
[Bugfix #560] fix: Track scroll state externally to survive display:n…
Merge pull request #561 from cluesmith/builder/bugfix-560-terminal-st…
[Bugfix #563] fix: Revert safeFit() condition to use only buffer baseY
[Bugfix #573] Fix scroll-to-top: ignore onScroll events when containe…