Skip to content

feat(terminal): swap sessions across tabs and drag-to-detach tabs to window - #10710

Draft
emmahyde wants to merge 10 commits into
stablyai:mainfrom
emmahyde:feat/terminal-pane-swap-and-drag-detach
Draft

emmahyde wants to merge 10 commits into
stablyai:mainfrom
emmahyde:feat/terminal-pane-swap-and-drag-detach

Conversation

@emmahyde

@emmahyde emmahyde commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

This PR introduces two follow-up features for detachable terminals:

  1. Swap Terminal Sessions: Adds the "Swap with Session..." pane menu action and an overlay that swaps terminal sessions, PTY ownership, and agent authority maps across different tabs without tearing down active PTY processes.
  2. Drag-to-Detach: Intercepts active tab drag-and-drop near the BrowserWindow edges, cleanly cancelling the drag and calling the detach IPC to spawn the terminal tab in a new OS window.

ELI5

You can swap terminal sessions between tabs without killing processes, and drag a tab to the window edge to detach it into its own OS window — more flexible multi-monitor terminal layouts.

emmahyde added 10 commits July 25, 2026 21:25
- Wire 'Detach to Window' context menu action across main, tab group, and floating terminal tab bars
- Add detachable pane window manager and IPC handlers for seed handoff and tab reintegration
- Seed popout Zustand store with leaf layout PTY mapping and update document title to tab name
- Ensure live PTY attachment and PTY delivery interest in popout window
The detached terminal pane seed was missing repo and worktree metadata,
causing resolveTerminalWorktreeRoute() to return null and the terminal
to show 'Workspace identity is ambiguous across hosts' error.

Add repo/worktree to DetachedTerminalTabSeed, populate repos and
worktreesByRepo in the popout store during seed application, and
look up the owning repo/worktree during capture.
Seeding worktreesByRepo in the popout store caused the terminal route
resolver to enter the explicit-worktree path, fail to find the actual
worktree (ID format mismatch), and fall through to 'missing' — then
the non-empty worktreesByRepo blocked the legacy fallback.

Fix: remove worktreesByRepo from the seed entirely, add
executionHostId/connectionId to the repo seed so the repo-indexed
fallback path (resolveIndexedRepoOperationRoute) can match, and let
the existing resolution chain handle the rest.
The multi-select 'Detach Tabs to Window' handler iterated all selected
tabs and called onDetachToWindow for each, creating N separate popout
windows. Since the popout window architecture supports one tab per
window, only detach the first selected tab.
Anchor the absolute terminal surface to its content slot so grouped tab controls remain visible.

Confidence: high
Scope-risk: narrow

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants