running wt should use the current working directory #4355

Closed
opened 2026-01-30 23:44:59 +00:00 by claunia · 4 comments
Owner

Originally created by @stax76 on GitHub (Oct 9, 2019).

When you start cmd or powershell with ShellExecuteEx or CreateProcess then you can define a working directory, cmd or powershell will start with that working directory but not wt. Is this unsupported or is there a setting?

SHELLEXECUTEINFO shExecInf

shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
shExecInfo.fMask = NULL;
shExecInfo.hwnd = hwnd;
shExecInfo.lpVerb = verb.c_str();
shExecInfo.lpFile = path.c_str();
shExecInfo.lpParameters = args.c_str();
shExecInfo.lpDirectory = DirectoryExist(szDir) ? szDir : NULL;
shExecInfo.nShow = Items[i]->HideWindow ? SW_HIDE : SW_NORMAL;
shExecInfo.hInstApp = NULL;

Originally created by @stax76 on GitHub (Oct 9, 2019). When you start cmd or powershell with ShellExecuteEx or CreateProcess then you can define a working directory, cmd or powershell will start with that working directory but not wt. Is this unsupported or is there a setting? SHELLEXECUTEINFO shExecInf shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); shExecInfo.fMask = NULL; shExecInfo.hwnd = hwnd; shExecInfo.lpVerb = verb.c_str(); shExecInfo.lpFile = path.c_str(); shExecInfo.lpParameters = args.c_str(); **shExecInfo.lpDirectory = DirectoryExist(szDir) ? szDir : NULL;** shExecInfo.nShow = Items[i]->HideWindow ? SW_HIDE : SW_NORMAL; shExecInfo.hInstApp = NULL;
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-30 23:44:59 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 9, 2019):

/dup #878

If you set "startingDirectory": null in your profiles, they'll launch in the current working directory. Be careful, though: they'll also launch in System32 when you start WT from the start menu.

We're working on that one.

For anything else, you'll want #607 (which we hope to use to allow you to specify a working directory.)

@DHowett-MSFT commented on GitHub (Oct 9, 2019): /dup #878 If you set `"startingDirectory": null` in your profiles, they'll launch in the current working directory. Be careful, though: they'll also launch in `System32` when you start WT from the start menu. We're working on that one. For anything else, you'll want #607 (which we hope to use to allow you to specify a working directory.)
Author
Owner

@ghost commented on GitHub (Oct 9, 2019):

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 (Oct 9, 2019): 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!
Author
Owner

@stax76 commented on GitHub (Oct 9, 2019):

I really appreciate the fast support. I don't use the start menu for that anyway so "startingDirectory": null will be fine for me. Thanks.

@stax76 commented on GitHub (Oct 9, 2019): I really appreciate the fast support. I don't use the start menu for that anyway so "startingDirectory": null will be fine for me. Thanks.
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 9, 2019):

Awesome! Happy to help. 😄

@DHowett-MSFT commented on GitHub (Oct 9, 2019): Awesome! Happy to help. :smile:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4355