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

Windows Terminal Preview will cover the command-line's color scheme of wsl2(Ubuntu) #14240

Closed
Submerging opened this issue Oct 17, 2022 · 7 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@Submerging
Copy link

Submerging commented Oct 17, 2022

Windows Terminal version

Version: 1.16.2642.0

Windows build number

10.0.25182.1010

Other Software

WSL version: 0.70.0.0
Kernel version: 5.15.68.1
WSLg version: 1.0.45
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.25182.1010

Steps to reproduce

open wsl2 in Windows Terminal Preview;
the ubuntu command line color, such as ls, vim, shows white for all words rather than the color inherited from PS1 and LS_COLORS from file .bashrc in Ubuntu. This change occurs after some update of Win11.

Windows Terminal still works well with the same setting.json.

Expected Behavior

I expect to use command line color inherited from my individual PS1 and LS_COLORS of file .bashrc in Ubuntu
image

Actual Behavior

image

@Submerging Submerging added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 17, 2022
@lhecker
Copy link
Member

lhecker commented Oct 17, 2022

I'm assuming ls --color=always doesn't make any difference, but something like printf "\e[38;2;192;64;0mfoo\e[m\n" works?
Could you share your settings.json file with us? You can strip out any private information (like file paths, etc.). Alternatively I guess your shell might be emitting a DECRSTS sequence...

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Oct 17, 2022
@237dmitry
Copy link

237dmitry commented Oct 17, 2022

Are in ~/.bashrc the prompt PS1 escape sequences escaped? Like this:

export PS1='\[\033[38;5;29m\] $(printf "%03d" \#)\[\033[38;5;95m\] \W \[\033[38;5;31m\]$ \[\033[0m\]'

@DHowett
Copy link
Member

DHowett commented Oct 17, 2022

Can you also share your settings.json file? Thanks!

@Submerging
Copy link
Author

I'm assuming ls --color=always doesn't make any difference, but something like printf "\e[38;2;192;64;0mfoo\e[m\n" works? Could you share your settings.json file with us? You can strip out any private information (like file paths, etc.). Alternatively I guess your shell might be emitting a DECRSTS sequence...

nothing surprises...
image

Actually, Windows terminal and Windows terminal preview share the same ubuntu‘s user of wsl kernel with the same .bashrc, and I use the same settings.json for both terminals as follows. Command still shows white words in Windows terminal preview, but Windows terminal works well like previous display.

//-------------settings.json--------
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command": "paste",
"keys": "ctrl+v"
},
{
"command":
{
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
},
{
"command": "find",
"keys": "ctrl+shift+f"
},
{
"command":
{
"action": "splitPane",
"split": "auto",
"splitMode": "duplicate"
},
"keys": "alt+shift+d"
}
],
"copyFormatting": "none",
"copyOnSelect": false,
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"profiles":
{
"defaults":
{
"backgroundImage": "C:\somedirectory\starlake.jpg",
"backgroundImageOpacity": 0.80000000000000004,
"closeOnExit": "graceful",
"cursorColor": "#FFFFFF",
"cursorShape": "bar",
"font":
{
"face": "Source Code Pro",
"size": 13
},
"historySize": 9001,
"opacity": 90,
"useAcrylic": false
},
"list":
[
{
"colorScheme": "Terminal Salf Scheme",
"commandline": "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"intenseTextStyle": "bright",
"name": "Windows PowerShell"
},
{
"commandline": "%SystemRoot%\System32\cmd.exe",
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "Command Prompt"
},
{
"font":
{
"face": "Source Code Pro",
"size": 13
},
"guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
"hidden": false,
"name": "Ubuntu-20.04",
"source": "Windows.Terminal.Wsl"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"guid": "{1080f0f7-df42-5820-9486-fd28e1465129}",
"hidden": false,
"name": "Developer Command Prompt for VS 2019",
"source": "Windows.Terminal.VisualStudio"
},
{
"guid": "{772d1d44-80f2-505e-8e12-ce9c9e6c1b34}",
"hidden": false,
"name": "Developer PowerShell for VS 2019",
"source": "Windows.Terminal.VisualStudio"
}
]
},
"schemes":
[
{
"background": "#0C0C0C",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#12456",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell Powershell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#282C34",
"black": "#282C34",
"blue": "#61AFEF",
"brightBlack": "#5A6374",
"brightBlue": "#61AFEF",
"brightCyan": "#56B6C2",
"brightGreen": "#98C379",
"brightPurple": "#C678DD",
"brightRed": "#E06C75",
"brightWhite": "#DCDFE4",
"brightYellow": "#E5C07B",
"cursorColor": "#FFFFFF",
"cyan": "#56B6C2",
"foreground": "#DCDFE4",
"green": "#98C379",
"name": "One Half Dark",
"purple": "#C678DD",
"red": "#E06C75",
"selectionBackground": "#FFFFFF",
"white": "#DCDFE4",
"yellow": "#E5C07B"
},
{
"background": "#FAFAFA",
"black": "#383A42",
"blue": "#0184BC",
"brightBlack": "#4F525D",
"brightBlue": "#61AFEF",
"brightCyan": "#56B5C1",
"brightGreen": "#98C379",
"brightPurple": "#C577DD",
"brightRed": "#DF6C75",
"brightWhite": "#FFFFFF",
"brightYellow": "#E4C07A",
"cursorColor": "#4F525D",
"cyan": "#0997B3",
"foreground": "#383A42",
"green": "#50A14F",
"name": "One Half Light",
"purple": "#A626A4",
"red": "#E45649",
"selectionBackground": "#FFFFFF",
"white": "#FAFAFA",
"yellow": "#C18301"
},
{
"background": "#002B36",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#FFFFFF",
"cyan": "#2AA198",
"foreground": "#839496",
"green": "#859900",
"name": "Solarized Dark",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#FDF6E3",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#002B36",
"cyan": "#2AA198",
"foreground": "#657B83",
"green": "#859900",
"name": "Solarized Light",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#FFFFFF",
"cyan": "#06989A",
"foreground": "#D3D7CF",
"green": "#4E9A06",
"name": "Tango Dark",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#FFFFFF",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#000000",
"cyan": "#06989A",
"foreground": "#555753",
"green": "#4E9A06",
"name": "Tango Light",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#000000",
"black": "#EDECE3",
"blue": "#007A99",
"brightBlack": "#00FFCC",
"brightBlue": "#EDECE3",
"brightCyan": "#CC0029",
"brightGreen": "#00CC00",
"brightPurple": "#FF33FF",
"brightRed": "#FF7792",
"brightWhite": "#FF9900",
"brightYellow": "#EDECE3",
"cursorColor": "#FFFFFF",
"cyan": "#21EFEF",
"foreground": "#EDECE3",
"green": "#FF7792",
"name": "Terminal Salf Scheme",
"purple": "#FF8F44",
"red": "#EDECE3",
"selectionBackground": "#FFFFFF",
"white": "#FFFFFF",
"yellow": "#FF7792"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#80",
"brightBlack": "#808080",
"brightBlue": "#0000FF",
"brightCyan": "#00FFFF",
"brightGreen": "#00FF00",
"brightPurple": "#FF00FF",
"brightRed": "#FF0000",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFFF00",
"cursorColor": "#FFFFFF",
"cyan": "#8080",
"foreground": "#C0C0C0",
"green": "#8000",
"name": "Vintage",
"purple": "#800080",
"red": "#800000",
"selectionBackground": "#FFFFFF",
"white": "#C0C0C0",
"yellow": "#808000"
}
],
"theme": "dark"
}

//------end-------settings.json--------

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Oct 20, 2022
@Submerging
Copy link
Author

Are in ~/.bashrc the prompt PS1 escape sequences escaped? Like this:

export PS1='\[\033[38;5;29m\] $(printf "%03d" \#)\[\033[38;5;95m\] \W \[\033[38;5;31m\]$ \[\033[0m\]'

This is the PS1 I used:
export PS1='[\033[01;31m]\u[\033[00m]@[\033[01;32m]\h[\033[00m][[\033[01;33m]\t[\033[00m]]:[\033[01;34m]\w[\033[00m]$'

@DHowett
Copy link
Member

DHowett commented Oct 20, 2022

Hey @lhecker, this looks like #13989.

/dup #13989

@Submerging thanks for the report! It looks like you've got a version of the Source Code Pro font installed that incorrectly identifies itself as containing "colored" text when in actuality the text is not colored.

Another filer noted that this was fixed in 2020:

there was a release in 2020 with 'Removes SVG table to allow for color-coded text in text editing apps. (issue adobe-fonts/source-code-pro#250)' in the release notes.
#13989 (comment)

@ghost
Copy link

ghost commented Oct 20, 2022

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Oct 20, 2022
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels Oct 20, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

4 participants