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

Can't see what I type ("-", "%", etc are not displayed) #6424

Closed
CIPop opened this issue Jun 9, 2020 · 5 comments
Closed

Can't see what I type ("-", "%", etc are not displayed) #6424

CIPop opened this issue Jun 9, 2020 · 5 comments
Assignees
Labels
Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@CIPop
Copy link
Member

CIPop commented Jun 9, 2020

Environment

Windows build number:  Win32NT             10.0.19041.0 Microsoft Windows NT 10.0.19041.0
Windows Terminal version (if applicable): Windows Terminal (Preview) Version: 1.0.1402.0

Any other software?

            {
                // Make changes here to the powershell.exe profile.
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false, 
                "fontFace": "Cascadia Code PL",
                "fontSize": 8,
                "colorScheme": "Solarized Dark"
            },

Steps to reproduce

Enter git -m "123"
Enter test -- -- -- -- -- -- -- -- -- --

Expected behavior

I expect to see what I typed.

Actual behavior

image
image

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jun 9, 2020
@DHowett
Copy link
Member

DHowett commented Jun 9, 2020

I cannot recommend the solarized color scheme. The defaults in PowerShell do not interact with it properly. I recommend choosing literally any other theme. Sorry!

@DHowett DHowett closed this as completed Jun 9, 2020
@CIPop
Copy link
Member Author

CIPop commented Jun 9, 2020

@DHowett No can do: all other schemes are literally wrong 😜. (I was also not asking for a recommendation: I was pointing out a real bug.)

Joke aside: Cmder works just fine with the same scheme in powershell:
image

Any workarounds I can do right now to make it work like forcing the console foreground color?

Please re-open the issue: if you don't/can't support solarized, please remove the theme (using this bug to track). If you can fix it, please use this issue to track the resolution.

@DHowett DHowett self-assigned this Jun 9, 2020
@DHowett
Copy link
Member

DHowett commented Jun 9, 2020

(I’m assigning myself to fill in the discussion and handle this bug when I’m not on my phone.)

@DHowett
Copy link
Member

DHowett commented Jun 10, 2020

So, there's a few issues at play here.

  1. PowerShell defaults to printing parameters in "bright black" (silly name for gray); this is verifiable with Get-PSReadlineOption in a terminal that isn't set to Solarized right now. image
  2. It looks like the official Solarized palette makes the "bright black" color invisible or barely visible: Color fix needed?  altercation/solarized#220 Invisible text in iTerm, visible when highlighting altercation/solarized#376
  3. Terminal is crushing some colors out of existence (render: defer conversion of TextColor into COLORREF until actual rendering time (avoid ConPTY narrowing bugs) #2661, ConPTY does not support black background #293, don't mind the fact that 293 mentions only the background)
    • PowerShell can be mildly reconfigured to work around issues two and three (footnote 1)
  4. We don't have a color bumping algorithm yet. Cmder (which is actually just ConEmu) does, using DeltaE101. When two colors are too close to eachother, it will nudge them until they're not quite so close. We're tracking that in Implement Delta E 2000 to correct color perception #2638.

(1)

Set-PSReadLineOption -Colors @{ Parameter = "`e[38;5;239m"; Operator = "`e[38;5;239m"; }

This will actually force parameters/operators to be gray. Real gray. The way they were intended. It's equally unreadable on the standard Solarized Dark background, but it is at the very least visible.

@CIPop
Copy link
Member Author

CIPop commented Jun 10, 2020

Correction above: `e works only for PS running on .NET Core.

From #5896 (comment)

if ($IsCoreCLR) {
    $esc = "`e"
}
else {
    $esc = $([char]0x1b)
}

Set-PSReadLineOption -Colors @{
    Parameter = "$esc[96m"
    Operator  = "$esc[38;5;47m"
    comment   = "$esc[92m"
    String    = "$esc[38;5;51m"
}

This works just fine with Solarized Dark:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

2 participants