Same directory on new tab created #17601

Closed
opened 2026-01-31 05:47:21 +00:00 by claunia · 3 comments
Owner

Originally created by @DanRotaru on GitHub (May 29, 2022).

Same directory on new tab created

Current folder: D:\folder
New terminal tab location (always): C:\Users\username

Now when I'm opening new terminal tab, this location is user folder (C:\Users\username) but always when I open new tab I want to use terminal for same location, and I have 2 options:

  1. Go again in explorer, copy path, return to terminal app, type cd /d PATH
  2. Go again in explorer and open context menu, then click to open this folder in terminal

This 2 options it's just waste of my time, what if just add option (or make primary this feature) when I'm opening new tab to open in the same directory.

My Use Case (frequently used)

  1. Open Terminal app
  2. Run app/server, after terminal is freezing
  3. So, to use again terminal I need to choose from that 2 options:
  • Go again in explorer, copy path, return to terminal app, type cd /d PATH
  • Go again in explorer and open context menu, then click to open this folder in terminal

Thank you.

Originally created by @DanRotaru on GitHub (May 29, 2022). # Same directory on new tab created Current folder: D:\folder New terminal tab location (always): C:\Users\username Now when I'm opening new terminal tab, this location is user folder (C:\Users\username) but always when I open new tab I want to use terminal for same location, and I have 2 options: 1. Go again in explorer, copy path, return to terminal app, type cd /d PATH 2. Go again in explorer and open context menu, then click to open this folder in terminal This 2 options it's just **waste of my time**, what if just add option (or make primary this feature) **when I'm opening new tab to open in the same directory**. ## My Use Case (frequently used) 1. Open Terminal app 2. Run app/server, after terminal is freezing 3. So, to use again terminal I need to choose from that 2 options: - Go again in explorer, copy path, return to terminal app, type cd /d PATH - Go again in explorer and open context menu, then click to open this folder in terminal Thank you.
Author
Owner

@AltitudeApps commented on GitHub (May 30, 2022):

I like to use:
wt --window 0 new-tab -d .
to start a new tab, and have it be in the same directory that the first tab is in.

For example, if you are in C:\whatever\path\to\folder, and do wt -w 0 nt -d ., the new tab will open up in C:\whatever\path\to\folder.

(this doesn't work if you opened Terminal as Administrator, due to a bug.)

I just found that you can also use "Ctrl-Shift-D" to open a new tab, and that tab will open in the directory that the first tab was in when that tab originally opened. In other words, if the first tab started in C:\my\opening\path, then you changed to C:\some\other\path, then did "Ctrl-Shift-D", a new tab would open in C:\my\opening\path.

@AltitudeApps commented on GitHub (May 30, 2022): I like to use: `wt --window 0 new-tab -d .` to start a new tab, and have it be in the same directory that the first tab is in. For example, if you are in C:\whatever\path\to\folder, and do `wt -w 0 nt -d .`, the new tab will open up in C:\whatever\path\to\folder. (this doesn't work if you opened Terminal as Administrator, due to a bug.) I just found that you can also use "Ctrl-Shift-D" to open a new tab, and that tab will open in the directory that the first tab was in when that tab originally opened. In other words, if the first tab started in C:\my\opening\path, then you changed to C:\some\other\path, then did "Ctrl-Shift-D", a new tab would open in C:\my\opening\path.
Author
Owner

@zadjii-msft commented on GitHub (Jun 14, 2022):

Sounds like you'd be interested in Tutorial: Opening a tab/pane in the same directory in Windows Terminal/?

You can configure the shell to tell the Terminal what your CWD is, and then the "Duplicate Tab" action will just use that CWD

@zadjii-msft commented on GitHub (Jun 14, 2022): Sounds like you'd be interested in [Tutorial: Opening a tab/pane in the same directory in Windows Terminal](https://docs.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory)/? You can configure the shell to tell the Terminal what your CWD is, and then the "Duplicate Tab" action will just use that CWD
Author
Owner

@ghost commented on GitHub (Jun 18, 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 (Jun 18, 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#17601