[Bugfix #205] Fix terminal garbled output when revisiting tabs#207
Merged
waleedkadous merged 3 commits intomainfrom Feb 9, 2026
Merged
Conversation
Terminal components were unmounted/remounted on every tab switch, triggering WebSocket reconnection and full ring-buffer replay on fresh xterm.js instances. This produced garbled output with scattered characters and rendering artifacts. Fix: Track activated terminal tabs and render them persistently with CSS display:none for hidden tabs, avoiding reconnection and buffer replay entirely.
Verifies that Terminal components remain mounted (hidden via CSS) when switching tabs, and the same DOM element is reused when switching back.
When a terminal tab has no wsPath, show "No terminal session" message instead of rendering nothing. Preserves original behavior from renderTerminal.
4 tasks
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
Fixes #205
Root Cause
When switching tabs in the dashboard, React unmounted and remounted Terminal components. Each remount:
This produced garbled output — scattered characters, repeated partial words (e.g., "thinking" dozens of times), and rendering artifacts.
Fix
Keep Terminal components mounted when switching tabs by:
activatedTerminalsstate)display: nonefor inactive tabsWhen switching back to a terminal tab, the existing xterm.js instance is simply made visible — no reconnection, no buffer replay.
Files changed:
packages/codev/dashboard/src/components/App.tsx— ReplacedrenderContent()withrenderPersistentContent()that keeps terminals mountedpackages/codev/dashboard/src/index.css— Added.terminal-tab-panewrapper classTest Plan
App.terminal-persistence.test.tsx) verifying:display: nonewhen hidden, cleared when activeCMAP Review
To be added after 3-way review