Skip to content

feat: move panes to new tabs without restarting#17

Closed
khoi wants to merge 2 commits intomainfrom
khoiracle/sup-41-move-pane-to-a-new-tab-without-restarting-it
Closed

feat: move panes to new tabs without restarting#17
khoi wants to merge 2 commits intomainfrom
khoiracle/sup-41-move-pane-to-a-new-tab-without-restarting-it

Conversation

@khoi
Copy link
Copy Markdown
Contributor

@khoi khoi commented Apr 9, 2026

Summary

  • Problem: panes could not be moved into a fresh tab without recreating the terminal surface.
  • Why it matters: moving an active pane should preserve the live terminal session, focus, unread state, and agent activity.
  • What changed: the terminal host now rehomes an existing surface into a new tab, the Ghostty bridge exposes the action from the pane context menu, and the related snapshot/window tests cover the move flow.
  • What did NOT change (scope boundary): this does not add new socket or CLI behavior, and it does not change how ordinary new-tab or split creation works.

Rationale

The feature is only correct if the existing surface survives the move. Recreating the pane would drop process state and make the command misleading. The implementation therefore moves the current surface and retargets tab metadata around it instead of spawning a replacement.

User-visible / Behavior Changes

  • Pane context menus can move the selected pane into a new tab without restarting that terminal session.
  • Focus moves to the new tab with the same surface still active.
  • Unread notifications, tab title updates, and agent activity follow the moved surface.

Diagram (if applicable)

Before:
[move pane to new tab] -> [new tab created with a fresh surface] -> [original live pane cannot be preserved]

After:
[move pane to new tab] -> [existing surface is reattached into a new tab] -> [session, focus, and tab state stay intact]

Human Verification

  • Verified scenarios: ran make mac-lint; ran targeted macOS tests for TerminalHostStateSurfaceMoveTests, TerminalWindowFeatureTests, TerminalWindowRegistryTests, GhosttySurfaceViewContextMenuTests, SupatermDebugSnapshotResolverTests, and SPTargetResolverTests; the pushed branch also passed the pre-push hook with make web-check, make web-test, and make mac-test.
  • Edge cases checked: moving a pane out of a split leaves the source tab with the remaining pane; moving the only pane removes the source tab without closing the live surface; unread notification and agent activity state move with the surface.
  • What you did not verify: manual interactive QA in the macOS app after the latest main changes, because the branch is currently paused in a conflict during rebase.
  • How can a human manually verify this: open a split tab, start a long-running command in one pane, use the pane context menu to move that pane into a new tab, then confirm the command continues in the new tab and the source tab keeps only the remaining pane.

@khoi
Copy link
Copy Markdown
Contributor Author

khoi commented Apr 11, 2026

Closing all open PRs per request.

@khoi khoi closed this Apr 11, 2026
@khoi khoi deleted the khoiracle/sup-41-move-pane-to-a-new-tab-without-restarting-it branch April 11, 2026 13:09
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