wsl --unregister doesn't cause Linux distribution to disappear from New Tab drop-down list #8699

Closed
opened 2026-01-31 01:35:50 +00:00 by claunia · 10 comments
Owner

Originally created by @matkaz on GitHub (May 30, 2020).

Environment

Windows build number: 10.0.18363.0
Windows Terminal version: 1.0.1401.0

WSL enabled
Ubuntu 18.04 LTS
Ubuntu 20.04 LTS

Steps to reproduce

In power shell type:
wsl --unregister Ubuntu-18.04

Expected behavior

Ubuntu 18.04 disappears from the New Tab drop-down list (preferably: immidiately, could be: after restarting Windows Terminal).

Actual behavior

Even after restarting Windows Terminal Ubuntu 18.04 is still there:
obraz
After selecting it process exits with code 4294967295:
obraz

Originally created by @matkaz on GitHub (May 30, 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.18363.0 Windows Terminal version: 1.0.1401.0 WSL enabled Ubuntu 18.04 LTS Ubuntu 20.04 LTS ``` # Steps to reproduce In power shell type: `wsl --unregister Ubuntu-18.04` # Expected behavior Ubuntu 18.04 disappears from the New Tab drop-down list (preferably: immidiately, could be: after restarting Windows Terminal). # Actual behavior Even after restarting Windows Terminal Ubuntu 18.04 is still there: ![obraz](https://user-images.githubusercontent.com/12645105/83333280-06c0ff00-a2a0-11ea-8419-155873d81b59.png) After selecting it process exits with code 4294967295: ![obraz](https://user-images.githubusercontent.com/12645105/83333302-2526fa80-a2a0-11ea-8cad-c571d2cd8851.png)
Author
Owner

@DHowett commented on GitHub (May 30, 2020):

If the Ubuntu entry was created by Terminal, it will be removed on the next launch.

If you’re not seeing that behavior, can you share the output of wsl -l after removing a distribution?

@DHowett commented on GitHub (May 30, 2020): If the Ubuntu entry was created by Terminal, it will be removed on the next launch. If you’re not seeing that behavior, can you share the output of `wsl -l` after removing a distribution?
Author
Owner

@matkaz commented on GitHub (May 31, 2020):

Every entry was created when I've installed Ubuntu from Microsoft Store.
The output of wsl -l after removing the distribution was as expected:

Windows Subsystem for Linux Distributions:
Ubuntu-20.04 (Default)
@matkaz commented on GitHub (May 31, 2020): Every entry was created when I've installed Ubuntu from Microsoft Store. The output of `wsl -l` after removing the distribution was as expected: ``` Windows Subsystem for Linux Distributions: Ubuntu-20.04 (Default) ```
Author
Owner

@zadjii-msft commented on GitHub (Jun 5, 2020):

Wait to be clear - when you relaunch the terminal, does the uninstalled distro get removed from the list of profiles?

@zadjii-msft commented on GitHub (Jun 5, 2020): Wait to be clear - when you relaunch the terminal, does the uninstalled distro get removed from the list of profiles?
Author
Owner

@matkaz commented on GitHub (Jun 6, 2020):

No, it didn't. I tried restarting terminal as well as Windows. Eventually, it got removed when I removed the entry on my own in settings.json.

@matkaz commented on GitHub (Jun 6, 2020): No, it didn't. I tried restarting terminal as well as Windows. Eventually, it got removed when I removed the entry on my own in settings.json.
Author
Owner

@zadjii-msft commented on GitHub (Jun 8, 2020):

Well, that's certainly unexpected then.

@zadjii-msft commented on GitHub (Jun 8, 2020): Well, that's certainly unexpected then.
Author
Owner

@DHowett commented on GitHub (Jun 8, 2020):

Hey @matkaz, would you mind sharing your settings file?

@DHowett commented on GitHub (Jun 8, 2020): Hey @matkaz, would you mind sharing your settings file?
Author
Owner

@matkaz commented on GitHub (Jun 9, 2020):

@DHowett sure: settings.json.txt.

Please, keep in mind that I've already removed the faulty entry. One thing that I noticed while removing the entry was that it had much more fields than Ubuntu 20.04 entry. It resembled Azure or PowerShell entries.

(Also: I've renamed settings.json to setting.json.txt as GitHub complains about attaching a file with .json extension...)

@matkaz commented on GitHub (Jun 9, 2020): @DHowett sure: [settings.json.txt](https://github.com/microsoft/terminal/files/4754162/settings.json.txt). Please, keep in mind that I've already removed the faulty entry. One thing that I noticed while removing the entry was that it had much more fields than Ubuntu 20.04 entry. It resembled Azure or PowerShell entries. (Also: I've renamed settings.json to setting.json.txt as GitHub complains about attaching a file with `.json` extension...)
Author
Owner

@DHowett commented on GitHub (Jun 9, 2020):

much more fields than Ubuntu 20.04

So, yeah, this is what I was wondering about. There's a narrow band of settings files that predated version 0.5 (yours looks like one of them!) that still had WSL autodetection applied to them. To preserve user data/user customization, those settings files aren't migrated or replaced.

Unfortunately, they didn't include enough information for Terminal to use to automatically hide WSL distributions that were removed after the settings block for them was generated. Terminal errs on the side of caution here and keeps the profile around.

At the end of the day, those old profiles are indistinguishable from profiles you have added yourself. We wouldn't want to delete one of those 😄

It looks like you came in after 0.2 or 0.3 (since your default key bindings are on ctrl+shift instead of just ctrl), so migrating will be a lot less painful. If you're interested, Scott Hanselman put together a blog post about the new settings and how you can migrate. If you're comfortable doing so, I'd recommend it.

@DHowett commented on GitHub (Jun 9, 2020): > much more fields than Ubuntu 20.04 So, yeah, this is what I was wondering about. There's a narrow band of settings files that predated version 0.5 (yours looks like one of them!) that still had WSL autodetection applied to them. To preserve user data/user customization, those settings files aren't migrated or replaced. Unfortunately, they didn't include enough information for Terminal to use to automatically hide WSL distributions that were removed after the settings block for them was generated. Terminal errs on the side of caution here and keeps the profile around. At the end of the day, those old profiles are indistinguishable from profiles you have added yourself. We wouldn't want to delete one of those :smile: It looks like you came in after 0.2 or 0.3 (since your default key bindings are on <kbd>ctrl+shift</kbd> instead of just <kbd>ctrl</kbd>), so migrating will be a lot less painful. If you're interested, Scott Hanselman put together a [blog post about the new settings](https://www.hanselman.com/blog/NowIsTheTimeToMakeAFreshNewWindowsTerminalProfilesjson.aspx) and how you can migrate. If you're comfortable doing so, I'd recommend it.
Author
Owner

@DHowett commented on GitHub (Jun 9, 2020):

(The new settings file format leaves out 90% of the information in the old one, and gives you more pointers about where to apply customizations.)

I'm gonna close this one out as "old settings file; an abundance of caution stopped us from deleting a profile we thought was yours". In the future, all autodetected profiles (profiles with a source) will be handled correctly.

@DHowett commented on GitHub (Jun 9, 2020): (The new settings file format leaves out 90% of the information in the old one, and gives you more pointers about where to apply customizations.) I'm gonna close this one out as "old settings file; an abundance of caution stopped us from deleting a profile we thought was yours". In the future, all autodetected profiles (profiles with a `source`) will be handled correctly.
Author
Owner

@matkaz commented on GitHub (Jun 10, 2020):

@DHowett Thanks, it makes perfect sense. Indeed, that's true I've started using Terminal before 1.0 was released.
I'll try to make my settings.json be more modern, to avoid bugs like this one in the future.

@matkaz commented on GitHub (Jun 10, 2020): @DHowett Thanks, it makes perfect sense. Indeed, that's true I've started using Terminal before 1.0 was released. I'll try to make my settings.json be more modern, to avoid bugs like this one in the future.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8699