Provide an option to use current tab directory if available as the startup directory #20423

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

Originally created by @trajano on GitHub (Aug 30, 2023).

Description of the new feature/enhancement

This makes it feel more like the macOS terminal where opening a new tab opens wherever the current tab's PWD is.

Right now process start up folder is generally useless since it tends to be C:/Windows/System32 I actually had to write a fallback script to say if it is C:/Windows/System32 to switch to $HOME.

Proposed technical implementation details (optional)

On open new tab, if option is set, pass the current tab's PWD if available.

Originally created by @trajano on GitHub (Aug 30, 2023). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 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 This makes it feel more like the macOS terminal where opening a new tab opens wherever the current tab's PWD is. Right now process start up folder is generally useless since it tends to be `C:/Windows/System32` I actually had to write a fallback script to say if it is `C:/Windows/System32` to switch to $HOME. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) On open new tab, if option is set, pass the current tab's PWD if available. <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 07:13:22 +00:00
Author
Owner
@zadjii-msft commented on GitHub (Aug 30, 2023): https://learn.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory
Author
Owner

@trajano commented on GitHub (Aug 30, 2023):

But it does not work on a different shell. Say I normally use Bash but I want to go CMD or Powershell because of some tooling that requires it.

@trajano commented on GitHub (Aug 30, 2023): But it does not work on a different shell. Say I normally use Bash but I want to go CMD or Powershell because of some tooling that requires it.
Author
Owner

@trajano commented on GitHub (Aug 30, 2023):

BTW for Oh-My-Posh (since you had Starship)

      - type: text
        style: plain
        alias: WindowsTerminalCwd
        template: "\u001b]9;9;{{.PWD}}\u001b\\"

@JanDeDobbeleer FYI in case you may want to add that to the featureset
UPDATE: Actually that won't work because .PWD uses ~ oh well

@trajano commented on GitHub (Aug 30, 2023): BTW for Oh-My-Posh (since you had Starship) ``` - type: text style: plain alias: WindowsTerminalCwd template: "\u001b]9;9;{{.PWD}}\u001b\\" ``` @JanDeDobbeleer FYI in case you may want to add that to the featureset UPDATE: Actually that won't work because `.PWD` uses `~` oh well
Author
Owner

@JanDeDobbeleer commented on GitHub (Aug 30, 2023):

@trajano this is available under general settings as pwd.

@JanDeDobbeleer commented on GitHub (Aug 30, 2023): @trajano this is available under [general settings](https://ohmyposh.dev/docs/configuration/general) as `pwd`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20423