Duplicated tab should retain the context of the source tab such as current folder path #18714

Closed
opened 2026-01-31 06:22:13 +00:00 by claunia · 4 comments
Owner

Originally created by @egvijayanand on GitHub (Oct 18, 2022).

Windows Terminal version

1.15.2875.0

Windows build number

10.0.22621.674

Other Software

No response

Steps to reproduce

Experiencing this issue in both Command Prompt and Windows PowerShell.

  1. Launch Windows Terminal
  2. Open a Command Prompt
  3. Navigate to any folder apart from the one configured in the launch profile
  4. Now duplicate this tab
  5. Go to the duplicated tab, and check the context of this tab, it is defaulting to the launch profile rather than the source tab

Expected Behavior

The duplicated tab should retain the source context. That's what duplication is (the same as how web browsers do).

Actual Behavior

Defaults to the launch profile rather than retaining the source context.

Originally created by @egvijayanand on GitHub (Oct 18, 2022). ### Windows Terminal version 1.15.2875.0 ### Windows build number 10.0.22621.674 ### Other Software _No response_ ### Steps to reproduce Experiencing this issue in both Command Prompt and Windows PowerShell. 1. Launch Windows Terminal 2. Open a Command Prompt 3. Navigate to any folder apart from the one configured in the launch profile 4. Now duplicate this tab 5. Go to the duplicated tab, and check the context of this tab, it is defaulting to the launch profile rather than the source tab ### Expected Behavior The duplicated tab should retain the source context. That's what duplication is (the same as how web browsers do). ### Actual Behavior Defaults to the launch profile rather than retaining the source context.
claunia added the Needs-TriageIssue-BugNeeds-Author-FeedbackNo-Recent-Activity labels 2026-01-31 06:22:14 +00:00
Author
Owner
@zadjii commented on GitHub (Oct 18, 2022): Did you configure your shell to set the CWD? See: https://github.com/microsoft/terminal/wiki/Frequently-Asked-Questions-(FAQ)#i-tried-to-duplicate-a-tabpane-and-it-didnt-duplicate-the-cwd-what-gives
Author
Owner

@egvijayanand commented on GitHub (Oct 18, 2022):

To answer your query, yes, have configured a starting directory for Command Prompt profile. This is for any tabs created newly using the Open a new tab action (or its shortcut key combination).

But how does that affect the Tab duplication feature? If the starting directory influences here, then the Duplicate loses its meaning.

Though the configured starting directory will be applied on creating a new tab, if it's duplicate tab action, the current context in the source tab should be applied on top of it.

As that is not the actual behavior, so this is an issue that is to be addressed.

@egvijayanand commented on GitHub (Oct 18, 2022): To answer your query, yes, have configured a starting directory for Command Prompt profile. This is for any tabs created newly using the `Open a new tab` action (or its shortcut key combination). But how does that affect the Tab duplication feature? If the starting directory influences here, then the Duplicate loses its meaning. Though the configured starting directory will be applied on creating a new tab, if it's duplicate tab action, the current context in the source tab should be applied on top of it. As that is not the actual behavior, so this is an issue that is to be addressed.
Author
Owner

@DHowett commented on GitHub (Oct 18, 2022):

Sorry, I believe Mike's query was whether you have configured Command Prompt to tell Terminal its most recent CWD. The FAQ page he linked further links out to Tutorial: Opening a tab or pane in the same directory in Windows Terminal.

It loosk like this tutorial makes a couple suggestions about how to fix this issue.

@DHowett commented on GitHub (Oct 18, 2022): Sorry, I believe Mike's query was whether you have configured Command Prompt to tell Terminal its most recent CWD. The FAQ page he linked further links out to [Tutorial: Opening a tab or pane in the same directory in Windows Terminal](https://learn.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory). It loosk like this tutorial makes a couple suggestions about how to fix this issue.
Author
Owner

@ghost commented on GitHub (Oct 22, 2022):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Oct 22, 2022): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18714