WSL profile generator inserts carriage returns into the distribution names #1547

Closed
opened 2026-01-30 22:30:03 +00:00 by claunia · 7 comments
Owner

Originally created by @DHowett-MSFT on GitHub (Jun 8, 2019).

image

This is also carried forward into the commandline, wsl.exe -d <distro>, as such:

{
    "commandline" : "wsl.exe -d Alpine\r\r"
}
Originally created by @DHowett-MSFT on GitHub (Jun 8, 2019). ![image](https://user-images.githubusercontent.com/14316954/59139146-f2c11680-8945-11e9-951f-fd1926ee02dc.png) This is also carried forward into the commandline, `wsl.exe -d <distro>`, as such: ```json { "commandline" : "wsl.exe -d Alpine\r\r" } ```
claunia added the Area-SettingsIssue-BugNeeds-Tag-FixProduct-Terminal labels 2026-01-30 22:30:03 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 8, 2019):

/cc @JBanks

@DHowett-MSFT commented on GitHub (Jun 8, 2019): /cc @JBanks
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 8, 2019):

As a note: this does prevent the distribution from being launched.

@DHowett-MSFT commented on GitHub (Jun 8, 2019): As a note: this does prevent the distribution from being launched.
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 9, 2019):

image

so I saw the settings (profiles.json), it looked crazy.

        {
            "acrylicOpacity" : 0.5,
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "wsl.exe -d Ubuntu(\uae30\ubcf8\uac12)\r\r",
            "cursorColor" : "#FFFFFF",
            "cursorShape" : "bar",
            "fontFace" : "Consolas",
            "fontSize" : 10,
            "guid" : "{6408c1b2-1145-55cb-b519-64a858cb4495}",
            "historySize" : 9001,
            "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png",
            "name" : "Ubuntu(\uae30\ubcf8\uac12)\r\r",
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "useAcrylic" : false
        }

So that, I have tried to open the WSL(ubuntu) profile with no changes with profiles, it closes right after open it. I couldn't even see the command line.

I have decoded \uae30\ubcf8\uac12 to UTF-8, 기본값 as Korean, which it is Default for English. (I am using windows as Korean, KO-KR)
Seems it runs (Default)\r\r at commandline so wsl couldn't run. BTW name should not have \r\r too.

from @Sjang1

@DHowett-MSFT commented on GitHub (Jun 9, 2019): > ![image](https://user-images.githubusercontent.com/29011440/59155310-72bfbb80-8ac1-11e9-95ca-77bb001f4917.png) > > so I saw the settings (profiles.json), it looked crazy. > > ``` > { > "acrylicOpacity" : 0.5, > "closeOnExit" : true, > "colorScheme" : "Campbell", > "commandline" : "wsl.exe -d Ubuntu(\uae30\ubcf8\uac12)\r\r", > "cursorColor" : "#FFFFFF", > "cursorShape" : "bar", > "fontFace" : "Consolas", > "fontSize" : 10, > "guid" : "{6408c1b2-1145-55cb-b519-64a858cb4495}", > "historySize" : 9001, > "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png", > "name" : "Ubuntu(\uae30\ubcf8\uac12)\r\r", > "padding" : "0, 0, 0, 0", > "snapOnInput" : true, > "useAcrylic" : false > } > ``` > > So that, I have tried to open the WSL(ubuntu) profile with no changes with profiles, it closes right after open it. I couldn't even see the command line. > > I have decoded \uae30\ubcf8\uac12 to UTF-8, 기본값 as Korean, which it is **Default** for English. (I am using windows as Korean, KO-KR) > Seems it runs (Default)\r\r at commandline so wsl couldn't run. BTW name should not have \r\r too. _from @Sjang1_
Author
Owner

@JBanks commented on GitHub (Jun 9, 2019):

@benhillis Can you tell me that the left parenthesis is a disallowed character in WSL Profile names? I couldn't see any restrictions here: https://github.com/Microsoft/WSL-DistroLauncher#getting-started

If so, I'll rework the code to stop at the parenthesis and then remove any spaces or carriage returns from the remaining string. I can also have this thrown into #1169 by Monday

If parenthesis are allowed, I could do a search for the localized default string with parenthesis wrapped around it and remove that from the line. This will require a bit more research as I haven't done localizations before. If this is the case, I'd like to merge #1169 to solve the /r problem and get it out of the way while I try to solve this.

@SJang1 When you decoded the string, did you place the decoded string back into profiles.json in order for it to show up properly in the flyout menu, or did that work well on it's own?

@JBanks commented on GitHub (Jun 9, 2019): @benhillis Can you tell me that the left parenthesis is a disallowed character in WSL Profile names? I couldn't see any restrictions here: https://github.com/Microsoft/WSL-DistroLauncher#getting-started If so, I'll rework the code to stop at the parenthesis and then remove any spaces or carriage returns from the remaining string. I can also have this thrown into #1169 by Monday If parenthesis are allowed, I could do a search for the localized default string with parenthesis wrapped around it and remove that from the line. This will require a bit more research as I haven't done localizations before. If this is the case, I'd like to merge #1169 to solve the /r problem and get it out of the way while I try to solve this. @SJang1 When you decoded the string, did you place the decoded string back into profiles.json in order for it to show up properly in the flyout menu, or did that work well on it's own?
Author
Owner

@benhillis commented on GitHub (Jun 9, 2019):

Parentheses and spaces are not allowed.

@benhillis commented on GitHub (Jun 9, 2019): Parentheses and spaces are not allowed.
Author
Owner

@SJang1 commented on GitHub (Jun 9, 2019):

@JBanks for encoding of UTF-8-BOM which is vs setting, it doesn't load and does not show up properly, changing to UTF-8 (no BOM) shows up well.
This is same to emotes, saving at vs(with bom) fails to reload and changing to no bom it works well. I think this could be another issue, BTW deleting encoding BOM, works very well with utf-8(decoded utf-16)

And for commandline, of course with something back at ubuntu, does not work.

@SJang1 commented on GitHub (Jun 9, 2019): @JBanks for encoding of UTF-8-BOM which is vs setting, it doesn't load and does not show up properly, changing to UTF-8 (no BOM) shows up well. This is same to emotes, saving at vs(with bom) fails to reload and changing to no bom it works well. I think this could be another issue, BTW deleting encoding BOM, works very well with utf-8(decoded utf-16) And for commandline, of course with something back at ubuntu, does not work.
Author
Owner

@JBanks commented on GitHub (Jun 9, 2019):

@SJang1 Everything from #1169 should fix your issue for now. It will end the line on spaces or parenthesis.

@JBanks commented on GitHub (Jun 9, 2019): @SJang1 Everything from #1169 should fix your issue for now. It will end the line on spaces or parenthesis.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1547