-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Starting the terminal in a non-WSL shell boots a WSL distribution whose shell is set as default in settings #8285
Comments
Please share a copy of your settings.json. |
I've updated the description @DHowett , let me know if there is anything else you'd like. |
Thanks. If you run When you launch Terminal via the Tasks list, and it goes to the wrong profile, what icon does it display? Does it use the settings from one profile (color scheme, font, etc.) but start an application from a different profile? |
Looks like I get the same behaviour when invoking it with Also, to clarify @DHowett, it is going to the correct profile, using the correct icons and settings, etc. The only problem that I think exists is that it seems to be starting the WSL distro as well. It's just pointless booting of a VM only for it to be stopped automatically shortly after. |
And if you do not set this WSL distribution as your default, it's definitely not booted? How about if you launch Windows PowerShell outside of terminal after shutting down WSL? WT doesn't do anything that should result in processes that are not part of a current active profile being run... |
When the WSL shell isn't set as my default profile and I start the app to a non-WSL profile, it doesn't start the distro. Additionally, if I set the default profile to the shell for my Ubuntu 18.04 distro, it starts that distribution instead of the Ubuntu one, so it's definitely only starting the shell that's configured as the default. This also means it's not specific to WSL 1 or WSL 2, it occurs on both. Starting powershell or CMD from outside of Windows Terminal does not cause this issue. |
Yeah, that version number thing is annoying. PowerShell doesn't know where to find the fourth component! Would you mind grabbing a process monitor trace? It might be enlightening, and help us see what Terminal is doing behind the scenes.
E-mail me the PML file -- or post it here (but it will include things like your username and some details about the file layout on your machine) -- at the address on my GitHub profile. Thanks! 😄 |
I've gathered the logs @DHowett and have sent the email. Let me know if there's anything else that you may need. |
I think I've got it. Thanks so much! We create a whole Since yours is
terminal/src/cascadia/TerminalSettingsModel/Profile.cpp Lines 405 to 409 in 6b503ba
@carlos-zamora remember how we talked about TerminalSettings proxying through to a profile? This is one issue where eagerly evaluating the profile values causes a problem. |
Awesome, glad you were able to narrow down a cause 🙂
|
The fix will probably be removing EvaluatedStartingDirectory from the profile interface & evaluating it in ConPtyConnection. |
/dup #9541 (sorry to dupe you to a higher number!) |
Environment
Steps to reproduce
defaultProfile
key in the settings JSON).wsl --shutdown
to stop all distros).Tasks
, open any non-WSL shell such as PowerShell or cmd.wsl --list --verbose
and observe that the WSL distribution whose shell is set to the default has been started and is now running.Expected behavior
When starting the Windows Terminal directly to a specified profile via right clicking on the application icon and selecting one of the
Tasks
, the default shell is not invoked. If the default shell is a WSL distribution shell, this means not booting the WSL distribution.Actual behavior
After starting Windows terminal directly to the powershell profile, I observed that the Ubuntu WSL distribution, whose shell is set as my default in Windows Terminal, was getting booted. The terminal would still load the Powershell profile correctly, it just starts the WSL distro even though it won't be getting used.
Settings.json
Note: I've removed the colour schemes, and I had no keybindings configured.
The text was updated successfully, but these errors were encountered: