[Bug Report] profiles.json hardcodes WSL Legacy #3099

Closed
opened 2026-01-30 23:13:00 +00:00 by claunia · 1 comment
Owner

Originally created by @mikeymop on GitHub (Aug 3, 2019).

Environment

Windows build number: Version 10.0.18362.239
Windows Terminal version (if applicable): 0.3.2142.0
Any other software?
    WSL, Ubuntu 1804 from Windows Store

Steps to reproduce

  • Have WSL setup already

  • Install Ubuntu 18.04 from windows store

  • Have the following two profiles from sample json into profiles.json

  • In cmd run wsl -s Ubuntu-18.04 to set it as default.

  • In cmd, run wsl and observe that you are in Ubuntu 18.04

  • Open Terminal Preview, open a tab representing the Ubuntu 18.04 profile

  • Observe you are in Legacy WSL

  • In Legacy WSL, run bash.exe or wsl.exe

  • Observe you are now in Ubuntu 18.04

Sample json

        {
            "acrylicOpacity" : 0.80000001192092896,
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "wsl.exe -d Legacy",
            "cursorColor" : "#FFFFFF",
            "cursorShape" : "bar",
            "fontFace" : "Hack",
            "fontSize" : 10,
            "guid" : "{6e9fa4d2-a4aa-562d-b1fa-0789dc1f83d7}",
            "historySize" : 9001,
            "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png",
            "name" : "WSL Bash",
            "name" : "Ubuntu (WSL)",
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "useAcrylic" : true
        },
        {
            "acrylicOpacity" : 0.80000001192092896,
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "wsl.exe -d Ubuntu-18.04",
            "cursorColor" : "#FFFFFF",
            "cursorShape" : "bar",
            "fontFace" : "Hack",
            "fontSize" : 10,
            "guid" : "{6e9fa4d2-a4aa-562d-b1fa-0789dc1f83d7}",
            "historySize" : 9001,
            "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png",
            "name" : "WSL Bash",
            "tabTitle" : "Ubuntu 18.04 (WSL)",
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "useAcrylic" : true
        }

Expected behavior

If you launch wsl from cmd, powershell or a wsl instance you have certain controls. You can use the -l flag to list your wsl instances, -d to launch one by name and -s to set a specific instance as the default.

If you launch this command from any commandline instance you have available, Linux or NT, it behaves as you expect.

I expect Terminal's profiles.json to respect these commandline flags and behave as if it is actually launching a subshell of the instance I choose to launch.

Hypothetically able to launch certain terminal applications directly from the commandline key.

Actual behavior

If you launch this command from the "commandline" key in the profiles.json wsl will always run legacy, regardless as to whether you -s set the default and launch bash.exe or wsl.exe or if you include -d in the commandline key and manually select your desired distribution.

Note

I did search and see #1674 read through it and determine that this bug is of a more specific nature as to the behavior of the Windows terminal than that issue and I believe it is of a different scope.

Originally created by @mikeymop on GitHub (Aug 3, 2019). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 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. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ``` Windows build number: Version 10.0.18362.239 Windows Terminal version (if applicable): 0.3.2142.0 Any other software? WSL, Ubuntu 1804 from Windows Store ``` # Steps to reproduce * Have WSL setup already * Install Ubuntu 18.04 from windows store * Have the following two profiles from sample json into `profiles.json` * In `cmd` run `wsl -s Ubuntu-18.04` to set it as default. * In cmd, run `wsl` and observe that you are in Ubuntu 18.04 * Open Terminal Preview, open a tab representing the Ubuntu 18.04 profile * Observe you are in Legacy WSL * In Legacy WSL, run `bash.exe` or `wsl.exe` * Observe you are now in Ubuntu 18.04 * ### Sample json ``` { "acrylicOpacity" : 0.80000001192092896, "closeOnExit" : true, "colorScheme" : "Campbell", "commandline" : "wsl.exe -d Legacy", "cursorColor" : "#FFFFFF", "cursorShape" : "bar", "fontFace" : "Hack", "fontSize" : 10, "guid" : "{6e9fa4d2-a4aa-562d-b1fa-0789dc1f83d7}", "historySize" : 9001, "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png", "name" : "WSL Bash", "name" : "Ubuntu (WSL)", "padding" : "0, 0, 0, 0", "snapOnInput" : true, "useAcrylic" : true }, { "acrylicOpacity" : 0.80000001192092896, "closeOnExit" : true, "colorScheme" : "Campbell", "commandline" : "wsl.exe -d Ubuntu-18.04", "cursorColor" : "#FFFFFF", "cursorShape" : "bar", "fontFace" : "Hack", "fontSize" : 10, "guid" : "{6e9fa4d2-a4aa-562d-b1fa-0789dc1f83d7}", "historySize" : 9001, "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png", "name" : "WSL Bash", "tabTitle" : "Ubuntu 18.04 (WSL)", "padding" : "0, 0, 0, 0", "snapOnInput" : true, "useAcrylic" : true } ``` # Expected behavior If you launch `wsl` from `cmd`, `powershell` or a `wsl` instance you have certain controls. You can use the `-l` flag to list your wsl instances, `-d` to launch one by name and `-s` to set a specific instance as the default. If you launch this command from any commandline instance you have available, Linux or NT, it behaves as you expect. I expect Terminal's `profiles.json` to respect these commandline flags and behave as if it is actually launching a subshell of the instance I choose to launch. Hypothetically able to launch certain terminal applications directly from the `commandline` key. # Actual behavior If you launch this command from the "commandline" key in the `profiles.json` wsl will always run legacy, regardless as to whether you `-s` set the default and launch `bash.exe` or `wsl.exe` or if you include `-d` in the commandline key and manually select your desired distribution. ## Note I did search and see #1674 read through it and determine that this bug is of a more specific nature as to the behavior of the Windows terminal than that issue and I believe it is of a different scope.
claunia added the Needs-TriageNeeds-Tag-Fix labels 2026-01-30 23:13:00 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 3, 2019):

It looks like you reused the same GUID for both profiles. Terminal can’t tell which one you really want in that case, so it picks the first.

@DHowett-MSFT commented on GitHub (Aug 3, 2019): It looks like you reused the same GUID for both profiles. Terminal can’t tell which one you really want in that case, so it picks the first.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3099