Powerlevel9k / powerlevel9k

Powerlevel9k was a tool for building a beautiful and highly functional CLI, customized for you. P9k had a substantial impact on CLI UX, and its legacy is now continued by P10k.
https://github.com/romkatv/powerlevel10k
MIT License
13.46k stars 947 forks source link

Gaps before separators #1313

Open VladimirMikulic opened 5 years ago

VladimirMikulic commented 5 years ago

Hi. I've just installed powerlevel9k and configured it, but I encountered problems. As the title says I have small gaps that appear before each separator. Zoom in the picture and you'll see what I am talking about.

Details:

Terminal: Tilix Font: Hack Nerd Font Regular (12)

terminalt

Yes, I tried to fix it, changed 100000 fonts, looked in every issue here on Github, read the troubleshooting page, but none of this helped.

I don't think that this is a problem related only to Tilix, the same thing I got with Konsole. So it should be a problem with fonts/configs.

Environment Information:

ZSH version: zsh 5.5.1 (x86_64-ubuntu-linux-gnu) ZSH Framework: Powerlevel9k Font: Nerd Fonts Powerlevel9k installation method: I've cloned the repo Powerlevel9k version: I don't know how to find it :( Terminal Emulator: Tilix, sometimes Konsole

Issues with Fonts & Icons

Font: Hack Nerd Font Regular (12) - Nerd Fonts Output of $get_icon_names is fine

font_issues_output.txt

romkatv commented 5 years ago

Those cursed gaps! Here are pretty much all the options you have:

  1. Try more font/terminal combinations until you find one that looks OK.
  2. Live with the gaps.
  3. Remove those triangles from your config.

I go with (3). My config is here. There are many other configs that ditched the triangles.

VladimirMikulic commented 5 years ago

@romkatv thanks for your response. 1) I tried 1000 of fonts, none of them worked(Mono ones have too small icons, normal ones have normal icons but with gaps)

2) It's hard, I can't :(

3) What triangles? There are no triangles, its the gap that creates that "triangle".

romkatv commented 5 years ago

What triangles?

Check it out:

space=" "
triangle="\uE0B0"
blue_space="%K{blue}$space%k"
blue_triangle="%F{blue}$triangle%f"

print -P "triangle      $triangle"
print -P "blue_space    $blue_space"
print -P "blue_triangle $blue_triangle"
print -P "powerline     $blue_space$blue_triangle"

triangles

That's how segment connections in powerline prompts are built. From spaces and triangles. If your terminal doesn't render triangles and spaces pixel-perfectly, there is nothing a theme can do. It doesn't operate on pixel level, it just prints spaces and triangles.

So you can either keep trying the next 1000 fonts, accept gaps as part of life, or purge the triangles from your config.

VladimirMikulic commented 5 years ago

@romkatv wow. Thank you VERY MUCH, I'll check this out. I might even get rid of these "triangles".

EDIT:

I don't know if this information will be useful to you, but I think its still worth to mention. This issue happened to me multiple times, every so often. I reinstall distro and it works fine. After the configuration, if I try to install other fonts or do something else connected with fonts, then this happens. So strange, I know, today I had enough of this and decided to report it.

Anyway, I appreciate your help.

romkatv commented 5 years ago

I reinstall distro and it works fine. After the configuration, if I try to install other fonts or do something else connected with fonts, then this happens.

Why change fonts if the preinstalled fonts work?

VladimirMikulic commented 5 years ago

You didn't understand me. I wasn't messing with powerline/nerd fonts. I was thinking about fonts globally. I tried to configure VS Code to render emojis properly. Although I succeeded, gaps appeared right afterwards.

romkatv commented 5 years ago

I tried to configure VS Code to render emojis properly. Although I succeeded, gaps appeared right afterwards.

This sounds like you've changed the font your terminal uses. Either this or you are really cursed. It could be some kind of cruel punishment for sins committed in past lives. Even stranger things happen.

VladimirMikulic commented 5 years ago

I didn't change the terminal font. All I did was to settings.json:

font-family: "Noto Color Emoji"

Also, I am Christian, no past lives :)

romkatv commented 5 years ago

I didn't change the terminal font.

That leaves the curse as the only explanation :scream:

Also, I am Christian

... in this life.

Seriously though, powerline style has been out of fashion for at least a year now. Switch to background-less prompt style while it's still cool! I linked to my config before but it's not the only one.

VladimirMikulic commented 5 years ago

That leaves the curse as the only explanation scream

Great help.

... in this life.

This is not a video game.

Switch to background-less prompt style while it's still cool

Hard to configure, I don't have 25 hours to spare right now.

romkatv commented 5 years ago

Great help.

I'm sorry for being facetious and for making light of the difficult decision you are facing. To the best of my knowledge, the three options I've outlined in my first comment are, unfortunately, exhaustive. (Or nearly exhaustive. You could also edit fonts by yourself or patch and recompile your terminal. I cannot suggest these in good faith.)

Another user has just reported having success with Hack Regular font: https://github.com/bhilburn/powerlevel9k/issues/1317#issuecomment-504711695.

VladimirMikulic commented 5 years ago

It's alright, no need to apologise. I knew for this workaround with Hack Regular font, but the problem with that is that some icons work, some icons are missing and some icons are too small.

IvanVolosyuk commented 4 years ago

"As the title says I have small gaps that appear before each separator." It looks like the problem is asymmetrical. Triangles pointing right are fine, while triangles pointing left are broken. I think the way to fix this might be to add inversed left triangle and swap foreground and background colors for it.