WSL home directory behaviour unexpected #10031

Open
opened 2026-01-31 02:10:43 +00:00 by claunia · 0 comments
Owner

Originally created by @pcolmer on GitHub (Aug 6, 2020).

Environment

Windows build number: 10.0.19041.0
Windows Terminal version (if applicable): 1.1.2021.0
Ubuntu 20.04.1 LTS

Steps to reproduce

  1. Install Ubuntu 20.04 as WSL.
  2. Start the default Ubuntu terminal.

Expected behavior

I would expect the terminal to start in the home directory of the user.

Actual behavior

The terminal starts at "/mnt/c/Users/phili", which is the Windows home directory.

Other notes

If you add a duplicate terminal profile, change the guid and comment out the source, it works as expected.

            {
                "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
                "hidden": false,
                "name": "Ubuntu",
                "source": "Windows.Terminal.Wsl",
                "commandline": "wsl.exe ~"
            },
            {
                "guid": "{daaee0d5-f525-4b10-98d1-d0ed1ede9f72}",
                "hidden": false,
                "name": "Ubuntu-no-source",
                // "source": "Windows.Terminal.Wsl",
                "commandline": "wsl.exe ~"
            },

In other words, the first profile above is the default one provided by Terminal. The second profile is my "hacked" one. The first one dumps me in my Windows home directory. The second one puts me in my Linux home directory.

In #6022, it was suggested that the behaviour changed depending on what had already happened, e.g. opening order or if WSL was already running. I took a video to show that this didn't seem to be the case for me.

Originally created by @pcolmer on GitHub (Aug 6, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 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! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.19041.0 Windows Terminal version (if applicable): 1.1.2021.0 Ubuntu 20.04.1 LTS ``` # Steps to reproduce 1. Install Ubuntu 20.04 as WSL. 2. Start the default Ubuntu terminal. # Expected behavior I would expect the terminal to start in the home directory of the user. # Actual behavior The terminal starts at "/mnt/c/Users/phili", which is the **Windows** home directory. # Other notes If you add a duplicate terminal profile, change the guid and comment out the source, it works as expected. ``` { "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}", "hidden": false, "name": "Ubuntu", "source": "Windows.Terminal.Wsl", "commandline": "wsl.exe ~" }, { "guid": "{daaee0d5-f525-4b10-98d1-d0ed1ede9f72}", "hidden": false, "name": "Ubuntu-no-source", // "source": "Windows.Terminal.Wsl", "commandline": "wsl.exe ~" }, ``` In other words, the first profile above is the default one provided by Terminal. The second profile is my "hacked" one. The first one dumps me in my Windows home directory. The second one puts me in my Linux home directory. In #6022, it was suggested that the behaviour changed depending on what had already happened, e.g. opening order or if WSL was already running. I took a video to show that this didn't seem to be the case for me. ![](https://user-images.githubusercontent.com/1979931/84661173-dd47da80-af11-11ea-8925-c34aa8fb0ba4.gif)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10031