Allow opening new tab/pane in same directory #8980

Closed
opened 2026-01-31 01:42:54 +00:00 by claunia · 2 comments
Owner

Originally created by @JelteF on GitHub (Jun 12, 2020).

Description of the new feature/enhancement

When opening a new tab or new pane it's nice if it opens in the same directory as the pane that it's being opened from. That way you don't have to cd again to the same directory.

Terminator, supports this as well as XFCE4 terminal (and probably more).

This was also suggested here: https://github.com/microsoft/terminal/issues/532#issuecomment-515180163

I guess it's nice if this is also linked in #1000

Proposed technical implementation details (optional)

@zadjii-msft responded to the original comment with this:

I'm not sure that's possible. Do all processes (including pico-processes used by WSL) have a current working directory? Is it possible for us to query that value from a child process? What if there are multiple processes attached to the console simultaneously, how do we pick which process's working directory to use?

Not saying that it's straight-up impossible, just that it's very unlikely and definitely deserves it's own thread to discuss and spec.

I don't think this needs to be thought of as this complex. I think all other terminal emulators simply use the cwd of the outer process. If you have spawned a subshell, the cwd of that one is simply ignored.

Originally created by @JelteF on GitHub (Jun 12, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement When opening a new tab or new pane it's nice if it opens in the same directory as the pane that it's being opened from. That way you don't have to `cd` again to the same directory. Terminator, supports this as well as XFCE4 terminal (and probably more). This was also suggested here: https://github.com/microsoft/terminal/issues/532#issuecomment-515180163 I guess it's nice if this is also linked in #1000 # Proposed technical implementation details (optional) @zadjii-msft responded to the original comment with this: > I'm not sure that's possible. Do all processes (including pico-processes used by WSL) have a current working directory? Is it possible for us to query that value from a child process? What if there are multiple processes attached to the console simultaneously, how do we pick which process's working directory to use? > >Not saying that it's straight-up impossible, just that it's very unlikely and definitely deserves it's own thread to discuss and spec. I don't think this needs to be thought of as this complex. I think all other terminal emulators simply use the cwd of the outer process. If you have spawned a subshell, the cwd of that one is simply ignored.
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 01:42:54 +00:00
Author
Owner

@DHowett commented on GitHub (Jun 12, 2020):

There's also /dup #3158, the solution to which should also help this

@DHowett commented on GitHub (Jun 12, 2020): There's also /dup #3158, the solution to which should also help this
Author
Owner

@ghost commented on GitHub (Jun 12, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Jun 12, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8980