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

(cherry picked from commit 10bdadf)
Service-Card-Id: 89001998
Service-Version: 1.17
  • Loading branch information
jamespack authored and DHowett committed Apr 25, 2023
1 parent cd28ed7 commit dd02ef0
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 dd02ef0

Please sign in to comment.