Repository navigation
feat(tabs): merge a tab's terminal panes into another tab from the tab menu - #16610
Draft
nickvirden wants to merge 3 commits into
Draft
nickvirden wants to merge 3 commits into
nickvirden wants to merge 3 commits into
Conversation
…b menu Adds "Merge into tab N: <title>" entries to the tab context menu. Choosing one moves every visible terminal pane of the source tab into the chosen tab as right-hand splits, keeping the running sessions alive, and closes the emptied source tab. A tab is only offered as a merge source when all of its panes are visible terminal panes, and eligibility is checked for the whole tab before any pane moves so a tab is never half-merged. Tabs that track child-agent panes are excluded. The feature is gated behind the default-off MergeTabIntoTab flag (`merge_tab_into_tab` cargo feature). Refs warpdotdev#8959 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @nickvirden on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment |
2 tasks done
Author
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
Resolves the feature-flag enum conflict by keeping both new variants. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Resolves the feature-flag enum conflict by taking master's tail and placing MergeTabIntoTab beside the other tab flags so later flag additions at the end of the enum no longer collide with it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.
Description
Adds "Merge into tab N: <title>" entries to the tab context menu. Choosing one moves every visible terminal pane of the source tab into the chosen tab as right-hand splits, keeps the running sessions alive, and closes the emptied source tab. It works in both vertical and horizontal tab layouts.
Today the only way to combine two existing tabs is to create a throwaway split in one, drag its pane header onto the other tab, and clean up the leftover pane. A single-pane tab has no pane header, so there is nothing to drag, and a tab-row drag only reorders tabs.
Behavior:
MergeTabIntoTabflag (merge_tab_into_tabcargo feature), so release behavior is unchanged.Not in this PR: dragging a tab onto a pane, cross-window merges, preserving the source tab's split layout, and an always-visible pane header setting.
Linked Issue
Refs #8959
ready-to-specorready-to-implement.#8959 currently carries
needs-info.ready-to-implementwas removed on 2026-07-07 while maintainers asked for more user-story detail, and it hasn't been restored. This PR is a draft so maintainers can accept the direction, ask for a different one, or close it. I'm happy to turn it into a spec PR if that's preferred. Context and open questions for the maintainers are in this comment on #8959.Testing
Automated:
app/src/pane_group/mod_tests.rsandapp/src/workspace/view_tests.rscover merge ordering, session identity surviving the move, the source tab closing, rejection of ineligible tabs with nothing moved, merging into itself, tab-group pruning, no undo entry, and the flag being inert when off. Three of them open the real context menu (horizontal tabs, the vertical-tabs kebab menu, and the vertical pane-row menu) and select a merge entry.crates/integration(test_merge_tab_into_tab_from_vertical_tab_context_menu,test_merge_tab_into_tab_from_horizontal_tab_context_menu,test_merge_tab_into_tab_keeps_sessions_alive) run in a real window.Manual: built with
./script/run --features merge_tab_into_tab, opened two tabs each running a live loop, and merged one into the other from the context menu. Both loops kept running with unbroken timestamps. Vertical tabs were exercised by hand. Horizontal tabs are covered by the integration test only../script/runMedia
Before: the tab menu has no merge entry
Right-clicking a tab offers no way to combine it with another open tab.
Before: dragging a tab into another tab does nothing
Dragging a tab row into another tab's terminal area leaves the two tabs separate, with no split.
before-no-merge.mp4
After: the tab menu offers "Merge into tab"
With the flag on, the tab context menu lists one "Merge into tab N: <title>" row per other tab.
After: the merged tab keeps both sessions running
Both terminals are now splits of one tab, and their timestamps continue without a restart.
After: merging two live tabs from the menu
The full flow: right-click a tab, choose the merge entry, and both running sessions end up side by side.
after-merge-into-tab.mp4
Known limitations
remove_pane_for_movepath, which logs tworeport_error!events ("Unable to locate a panel to activate after close" and "Pane not found"). The existing child-agent re-adopt path logs the same events. Filed as Moving the last pane out of a tab logs two report_error! events #16628.DragTabsToWindowsis off, so a tab-row drag into a terminal area is a no-op there. I haven't compared behavior on a build with that feature enabled.CHANGELOG-NONE