Nerd-fonts: Thin vertical blue line on my prompt

Created on 23 Apr 2017  路  16Comments  路  Source: ryanoasis/nerd-fonts

Hello,
I am using Oh My Zsh theme PowerLevel9k with nerd-fonts.
I use Gnome-Terminal, on Antergos (which is Arch Linux).
As my font, I both have patched with the font-patcher-py3 the following:

Droid Sans Mono for Powerline Nerd Font Complete.otf
Droid Sans Mono Nerd Font Complete.otf

The first one is the src/ font patched, while the second one is a vanilla patched.
Using both them gives the same effect.

This is the effect I get (the vertical blue line after the prompt), after changing the background color to that gray.
problem
Not only with this font, but with all the nerd fonts.

Here it is my .zshrc file:

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
  export ZSH=/home/riccardo/.oh-my-zsh

# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="powerlevel9k/powerlevel9k"

POWERLEVEL9K_MODE='nerdfont-complete'

DEFAULT_USER="riccardo"
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs)
POWERLEVEL9K_DISABLE_RPROMPT=true
POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=false
POWERLEVEL9K_DIR_HOME_BACKGROUND='251'
POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND='251'
POWERLEVEL9K_DIR_DEFAULT_BACKGROUND='251'
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND='236'
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND='236'
POWERLEVEL9K_DIR_HOME_FOREGROUND='236'

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(sudo, archlinux, bundler, docker, gem, gitfast, git-extras, git-flow, git-flow-avh, git-hubflow, git-remote-branch, github, pip, python, repo, sublime, vi-mode, brew, rvm, rails, git, npm, rake, ruby, zsh-completions)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# source /usr/share/nvm/init-nvm.sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm

DISABLE_UPDATE_PROMPT=true

zstyle ':completion:*' special-dirs true

export PATH="$HOME/.linuxbrew/bin:$PATH"


If I remove all the POWERLINE9K_..._BACKGROUND, the default background is blue.

How do I solve it? Thanks.

Most helpful comment

The line appears because of subpixel antialiasing. Check this setting in .Xresources: Xft.rgba
Line appears if it is set to "rgb" and disappears if value is set to "vrgb"
xrdb -query | grep Xft.rgba
Xft.rgba: vrgb

All 16 comments

I had a similar problem with Deja Vu Sans Mono on gnome-terminal. It improved for me when I switched to the "Mono" variant. What happens if you patch with --mono?

(I think @ryanoasis is also working on fixing these problems in the non-mono variants, but his work on that isn't finished yet.)

Patching it with ./font-patcher-py3 -c --mono -ext otf -out ~/.local/share/fonts/NerdFonts src/unpatched-fonts/DroidSansMono/Droid\ Sans\ Mono\ for\ Powerline.otf && fc-cache -fv keeps giving me the same issue.

@RiccardoMPesce Ah you are using the py3 version of the patcher right? I haven't updated that yet.

You did pull the latest of master ?

Anyway here are the results of Droid for me:

before fix:

selection_038

after fix:

selection_039

Let me update the py3 version and you can retry :smile:

@ryanoasis thanks for the effort. Unfortunately, the blue vertical line persist. Can it be the fact that I am using otf instead of ttf?

EDIT. it is the same. However, the blue line is less noticeable.

EDIT. it is the same. However, the blue line is less noticeable.

Well that is at least _some_ good news. I was going to say maybe you needed to clear your font cache and close all terminals.. but it sounds like you are seeing a difference?


Also for me the powerline glyph was more appropriately vertically centered. Did you notice any change with that as well?

Also, would you mind posting an updated screenshot?

partially solved

As you can see in the directory line, the blue line is less noticeable. :) Glyphs are okay now, are centered and there is a better padding around them.

EDIT. Later I will try tweaking oh_my_zsh and powerlevel9k a bit, as the problem seems to be derived from the back that the standard background color of blue is a feature of oh_my_zsh. I will update this as soon as I get everything done.

EDIT 2. the command echo $color gives me this output

none normal bg-blue 31 bold no-standout bg-magenta faint no-underline bg-cyan standout no-blink bg-white underline 33 41 01 blink no-reverse bg-default 27 no-conceal reverse conceal 30 31 08 39 02 32 24 45 35 05 34 30 39 47 black 23 red green 43 yellow 36 blue magenta 37 cyan 03 white 44 35 default 40 28 07 46 04 33 37 40 22 34 42 00 30 30 25 49 bg-black 36 32 bg-red bg-green bg-yellow

Maybe this is what should be changed. How do I do it?

@RiccardoMPesce Thanks for the updates. I'm unsure how to change those items in oh_my_zsh at the moment. We can look into this more...

Problem is the same here with Adobe Source Code Pro font and the last version of patcher :

bug

Do you have any solution for this problem ?

@RiccardoMPesce did you manage to solve this? How?

@fpaterno Could you please open a seperate issue if you have the same problem detailing your terminal config please?

I'm getting this same issue on pretty much all the fonts used in windows. Its really gross looking :(

I have the same issue with Inconsolata Nerd Font and i made some tests. Screenshots posted below are taken with bash shell, but same thing occurs with zsh so it's _shell indipendent_ (in some previous posts it was suggested that the issue may occur because of zsh or oh-my-zsh, but that's not the cause).
Also i tested with two different terminal emulators: st and xterm
With Inconsolata for Powerline (link) everything is smooth as it should be (screenshot 3 and 6), so the issue must be with Nerd Font patch. Inconsolata for Powerline
NOTE: Screenshots taken inside tmux, but behavior is the same outside of it.

  1. Problem occurs on st with Inconsolata Nerd Font
    st -f "Inconsolata Nerd Font:pixelsize=30"

  2. Same on st with Inconsolata Nerd Font Mono
    st -f "Inconsolata Nerd Font Mono:pixelsize=30"

  3. No problems with Inconsolata for Powerline (not Nerd Font)
    st -f "Inconsolata for Powerline:pixelsize=30"

  4. Even worse on xterm with Inconsolata Nerd Font (1px bottom right gaps)
    xterm -fa "Inconsolata Nerd Font:pixelsize=30"

  5. Even worse on xterm with Inconsolata Nerd Font Mono (2px bottom right gaps)
    xterm -fa "Inconsolata Nerd Font Mono:pixelsize=30"

  6. No issues with on xterm with Inconsolata for Powerline
    xterm -fa "Inconsolata for Powerline:pixelsize=30"

So i checked the glyphs and they look a bit different:
Inconsolata for Powerline:

Inconsolata Nerd Font Mono:

And that might be the cause.

EDIT Can confirm the issue is with the glyphs in Nerd Font patch. With FontForge i exported powerline glyphs from Inconsolata for Powerline and imported them to Inconsolata Nerd Font Mono and everything is working fine.

The line appears because of subpixel antialiasing. Check this setting in .Xresources: Xft.rgba
Line appears if it is set to "rgb" and disappears if value is set to "vrgb"
xrdb -query | grep Xft.rgba
Xft.rgba: vrgb

I'm running on Ubuntu MATE with GNOME Terminal, and I tried @dfokin 's fix, but it didn't work. What I ended up doing is switching to https://github.com/powerline/fonts/tree/master/Hack for my font. Works like a dream.

I am presenting this issue as well with nerd-fonts last version (commit 5f748cdb104a241ec8ac229f24518f3f867e8eb2) from master branch and "SauceCodePro Nerd Font Mono Medium", 12px:

image
image

in more detail:

image
image

I did the git pull, then run the install.sh script, reboot the system and the vertical line still persists.

I am using Fedora 32 with gnome-terminal 3.36.1.1 and the following configuration:

image

The antialiasing in GNOME Tweaks 3.34.0 is the following:

image

Appreciate any help to get this fixed.

Thanks.

Once I uninstalled packages from https://github.com/silenc3r/fedora-better-fonts the glyphs started to look better on the terminal. The left-side arrows look good now. The right-side one is still showing the vertical line on it:

image

and changing the terminal font size from 12 to 11, fixed completely:
image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

logarytm picture logarytm  路  5Comments

fornwall picture fornwall  路  5Comments

brontosaurusrex picture brontosaurusrex  路  4Comments

audioscavenger picture audioscavenger  路  3Comments

alpertuna picture alpertuna  路  5Comments