romkatv / powerlevel10k

A Zsh theme
MIT License
45.93k stars 2.17k forks source link

Tails have wrong color in VSCode #1802

Closed MetaMmodern closed 2 years ago

MetaMmodern commented 2 years ago

Hi, I did not want to actually create an inssue in the first place but I just can't find th solution for this. I''ve installed WSL, zsh, oh-my-zsh and p10k, selected themes and all that stuff. When I open VSCode Terminal and open Ubuntu WSL I see this: image Slanted edges are off color. And also there is a black one on the left side.

However it shows everything correctly in Windows Terminal: image (font enlarged to be sure)

BUT the most mindblowing part for me is: if I run code inside VSCode terminal in Ubuntu WSL, which brings a VSCode instance, attached to WSL itself. and then if I open terminal inside of it--the slantings are all good! image (check the left bottom corner: I've connected to wsl)

Now I can't understand whether it is shell, or wsl, or p10k, or vscode issue) Would be glad if someone helped here, thanks in advance.

romkatv commented 2 years ago

Your terminal defines how foreground and background colors with a certain color code look like. Directory uses color 4, status uses 0, and time uses 7. Your first screenshot shows that the terminal shows a different hue for the foreground and background 7. That's almost never what you want. Decent terminals allow you to customize this but I don't know whether your terminal allows that. We can also see that that the background 0 is the same as default background. This is also almost never what you want.

There is a bit more info here: https://github.com/romkatv/powerlevel10k#how-do-i-change-prompt-colors. Also relevant: https://github.com/romkatv/powerlevel10k#sub-pixel-imperfections-around-powerline-symbols.

The practical advice is to use Lean style. It's more robust in the face of terminal rendering bugs and quirks. Also see https://github.com/romkatv/powerlevel10k#what-is-the-best-prompt-style-in-the-configuration-wizard.

MetaMmodern commented 2 years ago

Hi, @romkatv , thank you for the review. Well, the style that I'm using is the main reason I installed p10k actually)))) So I'll try to figure out the way to keep it(especially while it works on third screenshot). Will inspect what you've shared, thank you.

MetaMmodern commented 2 years ago

okay, I checked a little bit of vscode settings and what I see:

  1. There is a settings which defines tails color, it is terminal.foreground: image And it solves the grayed out tails problem.
  2. The status bar of p10k uses color 0, which as a I understood is black and we can tell VSCode to change black in settings also as on screenshot below: image

So in p2 we see that terminal.ansiBlack is responsible for black color not only in status, but also in branch name and status tail. The hard part left is to figure out why it renders correctly in WSL VSCode while dropping the status background in default VSCode.

romkatv commented 2 years ago

Closing as the issue is not with powerlevel10k.

asash3 commented 2 years ago

https://github.com/microsoft/vscode/issues/146406#issuecomment-1084825473