Skip to content

fix: prevent terminal reset when splitting tab groups - #393

Merged
mathnogueira merged 1 commit into
mainfrom
mathnogueira/tab-split
Apr 9, 2026
Merged

mathnogueira merged 1 commit into
mainfrom
mathnogueira/tab-split

Conversation

@mathnogueira

@mathnogueira mathnogueira commented Apr 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Always render through TabGroupSplitLayout (even for single groups) so that splitting never switches rendering paths — which would unmount TabGroupPanel, destroying xterm instances and killing PTY processes
  • CSS Grid flat rendering in TabGroupSplitLayout keeps all TabGroupPanels as stable keyed siblings, so React preserves them across layout tree changes
  • Use effectiveVisibleRef in pty-connection.ts so split-but-visible terminals continue receiving PTY output instead of buffering it (a non-focused group is visible but not active)
  • Eagerly initialize layout in createUnifiedTab so every worktree has a layout node before the first split
  • Keep layout leaf when collapsing back to a single group instead of deleting it, preventing the unmount that would blank the remaining terminal
  • Prevent Monaco model disposal when a split editor unmounts — keepCurrentModel stops @monaco-editor/react from disposing the shared model that sibling editors depend on
  • Keep titlebar spacer visible during splits so the right sidebar toggle stays pushed to the far right

Test plan

  • All 33 tabs slice tests pass
  • TypeScript check clean
  • Split a terminal tab left/right/up/down — original terminal keeps running
  • Close the split tab — original terminal keeps running (not blank)
  • Split, then split again — all terminals stay alive
  • Editor tabs split correctly and share OpenFile state across groups
  • Non-active worktree terminals survive worktree switches
  • Session persistence round-trips correctly with split layouts
  • Closing split editor tab does not blank the editor in the other group
  • Right sidebar toggle stays at the far right in split mode

- Always render through TabGroupSplitLayout (even single groups) to prevent TerminalPane unmounts that kill PTY processes
- CSS Grid flat rendering keeps TabGroupPanels as stable keyed siblings across layout changes
- Use effectiveVisibleRef in pty-connection so split-but-visible terminals receive PTY output
- Eagerly initialize layout in createUnifiedTab before first split
- Keep layout leaf when collapsing to single group (prevent unmount)
- Prevent Monaco model disposal with keepCurrentModel so split editors share models safely
- Keep titlebar spacer visible in split mode for right sidebar toggle positioning
@mathnogueira
mathnogueira force-pushed the mathnogueira/tab-split branch from 9959971 to e06a31f Compare April 9, 2026 01:38
@mathnogueira
mathnogueira merged commit da7ddb0 into main Apr 9, 2026
1 check passed
nwparker added a commit that referenced this pull request Apr 9, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
- Always render through TabGroupSplitLayout (even single groups) to prevent TerminalPane unmounts that kill PTY processes
- CSS Grid flat rendering keeps TabGroupPanels as stable keyed siblings across layout changes
- Use effectiveVisibleRef in pty-connection so split-but-visible terminals receive PTY output
- Eagerly initialize layout in createUnifiedTab before first split
- Keep layout leaf when collapsing to single group (prevent unmount)
- Prevent Monaco model disposal with keepCurrentModel so split editors share models safely
- Keep titlebar spacer visible in split mode for right sidebar toggle positioning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant