Skip to content

Commit

Permalink
Skip generating a profile for rancher-desktop (#15166)
Browse files Browse the repository at this point in the history
Don't generate a profile for rancher-desktop utility WSL distro.

Adds a check for rancher-desktop as well as docker. As mentioned in the
discussion of this issue. This becomes much more difficult to maintain
once other folks inevitably start to follow this pattern. But the easy
win was up for grabs so I took it :)

Closes #12757
  • Loading branch information
jamespack committed Apr 12, 2023
1 parent 56d451d commit 10bdadf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cascadia/TerminalSettingsModel/WslDistroGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

static constexpr std::wstring_view WslHomeDirectory{ L"~" };
static constexpr std::wstring_view DockerDistributionPrefix{ L"docker-desktop" };
static constexpr std::wstring_view RancherDistributionPrefix{ L"rancher-desktop" };

// The WSL entries are structured as such:
// HKCU\Software\Microsoft\Windows\CurrentVersion\Lxss
Expand Down Expand Up @@ -78,9 +79,9 @@ static void namesToProfiles(const std::vector<std::wstring>& names, std::vector<
{
for (const auto& distName : names)
{
if (til::starts_with(distName, DockerDistributionPrefix))
if (til::starts_with(distName, DockerDistributionPrefix) || til::starts_with(distName, RancherDistributionPrefix))
{
// Docker for Windows creates some utility distributions to handle Docker commands.
// Docker for Windows and Rancher for Windows creates some utility distributions to handle Docker commands.
// Pursuant to GH#3556, because they are _not_ user-facing we want to hide them.
continue;
}
Expand Down

0 comments on commit 10bdadf

Please sign in to comment.