Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove carriage return from WSL distribution names. #1169

Merged
merged 9 commits into from
Jun 10, 2019

Conversation

JBanks
Copy link
Contributor

@JBanks JBanks commented Jun 8, 2019

Summary of the Pull Request

Checks the Distribution name for \r and removes it if necessary.

References

#1168

PR Checklist

Detailed Description of the Pull Request / Additional comments

One line to check for and remove any carriage return characters.

Validation Steps Performed

I've installed a second distribution and tested this to ensure that it now functions properly.

src/cascadia/TerminalApp/CascadiaSettings.cpp Outdated Show resolved Hide resolved
@@ -534,7 +534,11 @@ 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"( ");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd definitely leave a comment referring back to #1168 about how we need to make sure to stop the name at a parentheses, since "(default)" might be included in the output

@JBanks JBanks marked this pull request as ready for review June 10, 2019 14:04
Copy link
Contributor

@DHowett-MSFT DHowett-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless github is acting up, there's some minor spacing issues here. Otherwise, this looks great! Thanks!

src/cascadia/TerminalApp/CascadiaSettings.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/CascadiaSettings.cpp Outdated Show resolved Hide resolved
JBanks and others added 2 commits June 10, 2019 16:13
Removed spacing.

Co-Authored-By: Dustin L. Howett (MSFT) <duhowett@microsoft.com>
Removed Spacing

Co-Authored-By: Dustin L. Howett (MSFT) <duhowett@microsoft.com>
@DHowett-MSFT DHowett-MSFT merged commit b9d83ba into microsoft:master Jun 10, 2019
@DHowett-MSFT
Copy link
Contributor

Thanks for fixing this!

@JBanks JBanks deleted the WSLNewLine branch June 10, 2019 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WSL profile generator inserts carriage returns into the distribution names
4 participants