Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mikeymop opened this issue Aug 3, 2019 · 1 comment
Closed

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

mikeymop opened this issue Aug 3, 2019 · 1 comment
Labels
Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@mikeymop
Copy link

mikeymop commented 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.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Aug 3, 2019
@mikeymop mikeymop changed the title Bug Report profile.json hardcodes WSL Legacy [Bug Report] profile.json hardcodes WSL Legacy Aug 3, 2019
@mikeymop mikeymop changed the title [Bug Report] profile.json hardcodes WSL Legacy [Bug Report] profiles.json hardcodes WSL Legacy Aug 3, 2019
@DHowett-MSFT
Copy link
Contributor

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

2 participants