Different starting directory if launched via taskbar/start menu #8452

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

Originally created by @warrenbuckley on GitHub (May 21, 2020).

Description of the new feature/enhancement

I currently added %USERPROFILE%\AppData\Local\Microsoft\WindowsApps to my PATH so from the explorer address bar I can type wt and that it will launch that folder directly in Windows Terminal, in conjunction with the JSON setting set to the current folder.

{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
    "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles

            // Use this starting directory when launching from start menu/taskbar
            //"startingDirectory": "c:/code",

            // Allows wt in explorer address bar to launch that folder
            "startingDirectory": ".",
        }
        ....
    }
}

However if you open it from the taskbar/start menu then it will open at the folder C:\Windows\System32 which is perhaps not the most useful.

Proposed technical implementation details (optional)

Can I suggest a new JSON setting where it would be possible to set the starting directory if its invoked from the explorer address bar

Originally created by @warrenbuckley on GitHub (May 21, 2020). # Description of the new feature/enhancement I currently added `%USERPROFILE%\AppData\Local\Microsoft\WindowsApps` to my **PATH** so from the explorer address bar I can type `wt` and that it will launch that folder directly in Windows Terminal, in conjunction with the JSON setting set to the current folder. ``` { "$schema": "https://aka.ms/terminal-profiles-schema", "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", "profiles": { "defaults": { // Put settings here that you want to apply to all profiles // Use this starting directory when launching from start menu/taskbar //"startingDirectory": "c:/code", // Allows wt in explorer address bar to launch that folder "startingDirectory": ".", } .... } } ``` However if you open it from the taskbar/start menu then it will open at the folder `C:\Windows\System32` which is perhaps not the most useful. # Proposed technical implementation details (optional) Can I suggest a new JSON setting where it would be possible to set the starting directory if its invoked from the explorer address bar
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 01:29:47 +00:00
Author
Owner

@DHowett commented on GitHub (May 22, 2020):

Careful, you're gonna make @zadjii-msft sad! We spent a whole month investigating this, and it turns out there's no good solid reliable way to determine when we've been launched from explorer versus from anywhere else.

I know that this sounds crazy... but when we're launched it happens in a "breakaway" state because we're in a package. Sometimes, args come in that tell us how we were launched, but other times they don't.

More info in the PR where we tried to fix it, https://github.com/microsoft/terminal/pull/3547

I personally think startingDirectory was an abomination. That's just me.

For now, wt -d . is a viable (if unpleasant) workaround.

/dup #878 (which is closed won't fix, but we still care about it)

@DHowett commented on GitHub (May 22, 2020): Careful, you're gonna make @zadjii-msft sad! We spent a whole month investigating this, and it turns out there's no good solid reliable way to determine when we've been launched from explorer versus from anywhere else. I know that this sounds crazy... but when we're launched it happens in a "breakaway" state because we're in a package. Sometimes, args come in that tell us how we were launched, but other times they don't. More info in the PR where we tried to fix it, https://github.com/microsoft/terminal/pull/3547 I personally think `startingDirectory` was an abomination. That's just me. For now, `wt -d .` is a viable (if unpleasant) workaround. /dup #878 (which is closed won't fix, but we still care about it)
Author
Owner

@ghost commented on GitHub (May 22, 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 (May 22, 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!
Author
Owner

@warrenbuckley commented on GitHub (May 22, 2020):

Good to know you found it a problem as well then but currently can't solve it.
Hopefully something in the future can be solved for this problem.

Cheers for the feedback before just closing the issue, its appreciated @DHowett to get some context :)

@warrenbuckley commented on GitHub (May 22, 2020): Good to know you found it a problem as well then but currently can't solve it. Hopefully something in the future can be solved for this problem. Cheers for the feedback before just closing the issue, its appreciated @DHowett to get some context :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8452