Starting Directory being ignored for WSL #20366

Closed
opened 2026-01-31 07:11:32 +00:00 by claunia · 6 comments
Owner

Originally created by @HiDannyZ on GitHub (Aug 12, 2023).

Windows Terminal version

1.18.1462.0

Windows build number

10.0.22621.2134

Other Software

WSL

Steps to reproduce

I am trying to set my starting directory to a folder on my Desktop.

These are the steps I am following and I have been trying for the last 40 mins following guides online.

  1. Open Ubuntu Profile on windows terminal via UI or settings.json file
  2. Set Starting Directory to /c/Users/Danny/Desktop/Projects or /mnt/c/Users/Danny/Desktop/Projects
            {
                "elevate": false,
                "guid": "{51855cb2-8cce-5362-8f54-464b92b32386}",
                "hidden": false,
                "name": "Ubuntu",
                "source": "CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc",
                "startingDirectory": "/mnt/c/Users/Danny/Desktop/Projects"
            },

Expected Behavior

Windows terminal Ubuntu will now open in the projects folder on my desktop

Actual Behavior

Windows Terminal Ubuntu ignores all changes that I make to the starting directory.

No matter the change I always start at /home/hidanny.

Only when the starting directory is invalid, there is an effect via error on the ubuntu instance in windows terminal.

Originally created by @HiDannyZ on GitHub (Aug 12, 2023). ### Windows Terminal version 1.18.1462.0 ### Windows build number 10.0.22621.2134 ### Other Software WSL ### Steps to reproduce I am trying to set my starting directory to a folder on my Desktop. These are the steps I am following and I have been trying for the last 40 mins following guides online. 1. Open Ubuntu Profile on windows terminal via UI or settings.json file 2. Set Starting Directory to ```/c/Users/Danny/Desktop/Projects``` or ```/mnt/c/Users/Danny/Desktop/Projects``` ``` { "elevate": false, "guid": "{51855cb2-8cce-5362-8f54-464b92b32386}", "hidden": false, "name": "Ubuntu", "source": "CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc", "startingDirectory": "/mnt/c/Users/Danny/Desktop/Projects" }, ``` ### Expected Behavior Windows terminal Ubuntu will now open in the projects folder on my desktop ### Actual Behavior Windows Terminal Ubuntu ignores all changes that I make to the starting directory. No matter the change I always start at ```/home/hidanny```. Only when the starting directory is invalid, there is an effect via error on the ubuntu instance in windows terminal.
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 07:11:32 +00:00
Author
Owner

@237dmitry commented on GitHub (Aug 13, 2023):

What if you set the traditional Windows path as the starting directory? WSL will resolve it or not?

@237dmitry commented on GitHub (Aug 13, 2023): What if you set the traditional Windows path as the starting directory? WSL will resolve it or not?
Author
Owner

@zadjii-msft commented on GitHub (Aug 14, 2023):

Ah, this is that ubuntu.exe bug. The CanonicalGroupLimited.Ubuntu* profiles don't ever respect the startingDirectory. You'll want to use one of the Microsoft.Terminal.Wsl ones, or replace the commandline with wsl -d Ubuntu.

/dup #12961

@zadjii-msft commented on GitHub (Aug 14, 2023): Ah, this is that `ubuntu.exe` bug. The `CanonicalGroupLimited.Ubuntu*` profiles don't ever respect the startingDirectory. You'll want to use one of the `Microsoft.Terminal.Wsl` ones, or replace the commandline with `wsl -d Ubuntu`. /dup #12961
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Aug 14, 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 (Aug 14, 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!
Author
Owner

@aplotor commented on GitHub (Sep 22, 2025):

Ah, this is that ubuntu.exe bug. The CanonicalGroupLimited.Ubuntu* profiles don't ever respect the startingDirectory. You'll want to use one of the Microsoft.Terminal.Wsl ones, or replace the commandline with wsl -d Ubuntu.

/dup #12961

hi @zadjii-msft, just curious why this happens? i did wsl --install Ubuntu as usual on a new laptop and it installed a Ubuntu profile with "source": "Microsoft.WSL" (and a different guid) instead of the usual "source": "Windows.Terminal.Wsl"

and is there a way to switch the "source": "Microsoft.WSL" ubuntu to the "source": "Windows.Terminal.Wsl" one?

@aplotor commented on GitHub (Sep 22, 2025): > Ah, this is that `ubuntu.exe` bug. The `CanonicalGroupLimited.Ubuntu*` profiles don't ever respect the startingDirectory. You'll want to use one of the `Microsoft.Terminal.Wsl` ones, or replace the commandline with `wsl -d Ubuntu`. > > /dup [#12961](https://github.com/microsoft/terminal/issues/12961) hi @zadjii-msft, just curious why this happens? i did `wsl --install Ubuntu` as usual on a new laptop and it installed a Ubuntu profile with `"source": "Microsoft.WSL"` (and a different guid) instead of the usual `"source": "Windows.Terminal.Wsl"` and is there a way to switch the `"source": "Microsoft.WSL"` ubuntu to the `"source": "Windows.Terminal.Wsl"` one?
Author
Owner

@zadjii-msft commented on GitHub (Sep 22, 2025):

I've forgotten the exact details, but newer iterations of the Terminal and WSL intentionally changed that. Part of this is with the new Microsoft.WSL source - WSL in now in charge of managing the profiles, rather than Terminal. That should make things better for a variety of cases, though, I haven't been close enough to the project for the last year to know for sure.

@DHowett will know more than me here

@zadjii-msft commented on GitHub (Sep 22, 2025): I've forgotten the exact details, but newer iterations of the Terminal and WSL intentionally changed that. Part of this is with the new `Microsoft.WSL` source - WSL in now in charge of managing the profiles, rather than Terminal. That should make things better for a variety of cases, though, I haven't been close enough to the project for the last year to know for sure. @DHowett will know more than me here
Author
Owner

@DHowett commented on GitHub (Sep 22, 2025):

@aplotor The new WSL integration @zadjii-msft mentioned had a bug. which they fixed.

For now, you can edit your commandline property to remove --cd ~ from it.

WSL bug: https://github.com/microsoft/WSL/issues/13346
WSL fix: https://github.com/microsoft/WSL/pull/13350

I'm locking this issue because it is a two-year-old duplicate. If you continue to have issues, please file a new bug.

@DHowett commented on GitHub (Sep 22, 2025): @aplotor The new WSL integration @zadjii-msft mentioned had a bug. which they fixed. For now, you can edit your `commandline` property to remove `--cd ~` from it. WSL bug: https://github.com/microsoft/WSL/issues/13346 WSL fix: https://github.com/microsoft/WSL/pull/13350 I'm locking this issue because it is a two-year-old duplicate. If you continue to have issues, please file a new bug.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20366