Skip to content

Commit

Permalink
Remove carriage return and () from WSL distro names (#1169)
Browse files Browse the repository at this point in the history
* Eliminate carriage return character
* Add WSLName ending identifiers.
  • Loading branch information
JBanks authored and DHowett committed Jun 10, 2019
1 parent 19dbec8 commit b9d83ba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cascadia/TerminalApp/CascadiaSettings.cpp
Expand Up @@ -534,7 +534,14 @@ void CascadiaSettings::_AppendWslProfiles(std::vector<TerminalApp::Profile>& pro
if (wlinestream)
{
std::wstring distName;
std::getline(wlinestream, distName, L' ');
std::getline(wlinestream, distName, L'\r');
size_t firstChar = distName.find_first_of(L"( ");
// Some localizations don't have a space between the name and "(Default)"
// https://github.com/microsoft/terminal/issues/1168#issuecomment-500187109
if (firstChar < distName.size())
{
distName.resize(firstChar);
}
auto WSLDistro{ _CreateDefaultProfile(distName) };
WSLDistro.SetCommandline(L"wsl.exe -d " + distName);
WSLDistro.SetColorScheme({ L"Campbell" });
Expand Down

0 comments on commit b9d83ba

Please sign in to comment.