mintty / wsltty

Mintty as a terminal for Bash on Ubuntu on Windows / WSL
Other
3.12k stars 104 forks source link

Skip `docker*` DistributionName? #277

Closed puellanivis closed 3 years ago

puellanivis commented 3 years ago

I just spent a bunch of time looking into how to get the config-distros.sh file to ignore the docker distros. There’s pretty much zero reason I would ever really want to start up in those WSL distros, they’re just there to provide docker. Docker itself allows for integrating with other WSL distros as well, so my openSUSE WSL distro can access my docker instance just as well as anything else.

I eventually hacked something together to get only the context menus that I want, and I just manually deleted the unwanted Start Menu entries. Seems like a bit of a pain that could be avoided by just skipping over anything docker*) in theconfig()` case statement?

mintty commented 3 years ago

Duplicate; I postponed it following https://github.com/mintty/wsltty/issues/261#issuecomment-723872090,; also I don't have docker installed myself so I'm somehow missing a test case. Is it easy to tell a docker distro apart? Do their names all start with "docker"?

puellanivis commented 3 years ago

Ah, I went looking for another issue covering it, but didn’t think to look in that one.

Yes, it is reasonably easy to tell them apart as the DistributionName for the two are docker-desktop and docker-desktop-data.

PS: They also have a BasePath value of: \\?\C:\Users\${USERNAME}\AppData\Local\Docker\wsl\distro

mintty commented 3 years ago

I've uploaded a filtering version of the configuration script, for the next release. Feel free to download and test it. The script also takes a parameter -info for some checking. This patch does not catch the case (described in another issue) that a docker system gets setup as WSL default distribution.

puellanivis commented 3 years ago

Makes sense. Skipping the WSL default would be way harder.

mintty commented 3 years ago

PS: They also have a BasePath value of: \?\C:\Users\${USERNAME}\AppData\Local\Docker\wsl\distro

Now also filtering out a docker default distribution based on this information, easy enough.

mintty commented 3 years ago

Released 3.5.0.

puellanivis commented 3 years ago

Works amazing. Thanks! :)