fix(terminal): preserve live sessions when moving tabs between groups#47
Merged
GOODBOY008 merged 7 commits intoJul 16, 2026
Merged
Conversation
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
Root cause
MOVE_TAB_TO_NEW_GROUPreplaces a grid leaf with a branch. React consequently unmounts the oldTerminalGroupView, which previously owned every livePtyTerminalin the source group. The cleanup closes each WebSocket and backend PTY, and the replacement layout starts new shells.Stable keys cannot preserve components that move across different parents or whose parent hierarchy changes, so this separates live tab ownership from the layout tree.
User impact
Moving or splitting tabs now changes only their layout. Existing xterm instances, WebSocket connections, PTY sessions, terminal history, and running foreground commands stay alive.
Testing
pnpm test -- src/__tests__/terminal-tab-portals.test.tsx src/__tests__/grid-renderer.test.tsx? 2 files, 5 tests passedpnpm build? passedgrid-renderer.tsxwarningconnection.test.ts,pty-terminal-activation.test.tsx, andpty-terminal-scrollbar.test.tsxsettings-modal.tsx:293errorFixes #46
Related to #7