When using -d, make the parent process working dir also that directory #19556

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

Originally created by @fireattack on GitHub (Mar 19, 2023).

Originally assigned to: @zadjii-msft on GitHub.

Description of the new feature/enhancement

I have "Starting directory" option set to "Use parent process directory" for defaults and all the profiles.

Currently, if I run wt -w -1 -d D:\ in Win+R, it will start a new window/tab that starting at D:\. However, in that window, if I create any new tab, it starts at C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.16.10261.0_x64__8wekyb3d8bbwe> instead of expected D:.

Proposed technical implementation details (optional)

I think it makes sense if you're creating a new process of wt, it should use -d argument as its working dir if exists. This way, when creating new tab (with "Use parent process directory" set), it would also use that dir instead of a meaningless directory where wt.exe sits in.

Originally created by @fireattack on GitHub (Mar 19, 2023). Originally assigned to: @zadjii-msft on GitHub. <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 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 I have "Starting directory" option set to "Use parent process directory" for defaults and all the profiles. Currently, if I run `wt -w -1 -d D:\` in Win+R, it will start a new window/tab that starting at `D:\`. However, in that window, if I create any new tab, it starts at `C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.16.10261.0_x64__8wekyb3d8bbwe>` instead of expected D:\. # Proposed technical implementation details (optional) I think it makes sense if you're creating a new process of `wt`, it should use `-d` argument as its working dir if exists. This way, when creating new tab (with "Use parent process directory" set), it would also use that dir instead of a meaningless directory where `wt.exe` sits in.
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 06:47:07 +00:00
Author
Owner

@fireattack commented on GitHub (Mar 19, 2023):

This behavior is particularly weird because if I simply run wt in Win+R, it at least uses my %USERPROFILE% as working dir.

image

Only when -d is used it starts to use this dir:

image

But this could be bug #14817?

@fireattack commented on GitHub (Mar 19, 2023): This behavior is particularly weird because if I simply run `wt` in Win+R, it at least uses my %USERPROFILE% as working dir. ![image](https://user-images.githubusercontent.com/4130991/226150853-32b8cb75-2fc4-4f92-9ffd-6f784503ce53.png) Only when -d is used it starts to use this dir: ![image](https://user-images.githubusercontent.com/4130991/226150830-5f975af6-ca5c-4e2c-b2bc-69679c67a547.png) But this could be bug #14817?
Author
Owner

@zadjii-msft commented on GitHub (May 2, 2023):

Okay, I think I've cached this problem space all in (https://github.com/microsoft/terminal/issues/15052#issuecomment-1486729711), and I want to call this one a /dupe of #4637. Ultimately, you're looking for a way to control the CWD of Terminal itself, and I'm gonna use that thread for tracking a solution to that.

Thanks!

@zadjii-msft commented on GitHub (May 2, 2023): Okay, I think I've cached this problem space all in (https://github.com/microsoft/terminal/issues/15052#issuecomment-1486729711), and I want to call this one a /dupe of #4637. Ultimately, you're looking for a way to control the CWD of _Terminal itself_, and I'm gonna use that thread for tracking a solution to that. Thanks!
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (May 2, 2023):

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!

@microsoft-github-policy-service[bot] commented on GitHub (May 2, 2023): 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#19556