Repository navigation
Closed
Labels
Description
What and why
Right-clicking a tab shows only the move items (Move left / right / to start / to end). Opening a second shell with the same profile in the same folder means clicking the profile menu and then cd-ing back. Add Duplicate to the tab context menu so one click gives a new tab like the current one.
Behavior
- New item Duplicate in
TabMenu.svelte, above the move items, separated by a divider. - The new tab gets a fresh PTY session with the same profile and the same working directory as the source tab's main pane (
Tab.cwd, kept current by OSC 7). - If the source tab is split, the duplicate is split the same way: same direction, second pane with its own profile and cwd. This matches what session restore already does (
restoreSessioninApp.svelte). - The duplicate opens right after the source tab and becomes the active tab.
- A custom (renamed) title is copied; an automatic title is not, so the new tab labels itself from its own folder / program.
- Shell state is not cloned: no scrollback, no running program, no env changes or shell history from the source session.
- If spawning fails, show the existing toast (
Failed to open tab: ...), likeopenNewTab.
Implementation notes
TabStrip.sveltegets anonDuplicateTab(tabId)prop;App.svelteimplements it withopenNewTab(profileId, cwd)+splitTab(...), then moves the tab next to the source withmoveTab.- The menu height clamp in
TabMenu.svelte(innerHeight - 140) needs to grow for the extra row. - Command palette entry "Duplicate tab" is a possible follow-up, not part of this issue.
Acceptance criteria
- Right-click a tab, choose Duplicate: a new tab opens next to it, active, running the same profile in the same folder.
- Duplicating a split tab produces a split tab with both panes' profile and folder.
- A renamed tab keeps its name in the duplicate.
- A spawn failure shows a toast and leaves the tab list unchanged.
- The item works with keyboard (arrow keys, Enter) like the other menu items.
- Unit test for the pure part (insert position / title carry-over);
/cipasses. -
CHANGELOG.mdhas a line under[Unreleased].
Non-goals
Cloning scrollback or running processes; a keyboard shortcut; duplicating into a new window.
Activity