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

(screenshot attached) Glyph not showing up on terminal #1258

Open harrythedev opened 5 years ago

harrythedev commented 5 years ago

Here is my fontbook: Screen Shot 2019-04-25 at 11 52 47 AM and ~/.fonts: Screen Shot 2019-04-25 at 11 53 07 AM

and my terminal looks like this: i get all questionmark icons where glyph should be...

Screen Shot 2019-04-25 at 11 52 10 AM

here 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="/Users/hhur/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="powerlevel9k/powerlevel9k"

#powerlevel19k configuration
POWERLEVEL9K_MODE="awesome-fontconfig"

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# 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.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# 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?
# Standard 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=(git)

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 ~/.fonts/*.sh

I'm pretty sure i've set everything up properly... Can anyone please help me out?

flohw commented 5 years ago

Same here, I tried to reinstall the fonts for the different configuration of POWERLEVEL9K_MODE. I'm not sure it's due to powerlevel as the issue has arrived after an OMZ update and I keep the theme on the tags. I tried on master and next but it didn't fix the issue. My configuration on my personal computer (which doesn't use OMZ) still works fine.

JHerseth commented 5 years ago

According to the install instructions POWERLEVEL9K_MODE="awesome-fontconfig" should be defined before you set the theme, so try moving it up and see if that helps.

harrythedev commented 5 years ago

@JHerseth I've tried that and it didn't work. :/

romkatv commented 5 years ago

You can configure your theme to not use non-standard glyphs. Then it'll work with any font that comes preinstalled on your system. I use Pure Power config, which makes my terminal look like this:

Pure Power

Lean and clean. No patched fonts required.

flohw commented 5 years ago

@romkatv we don't want to change font, we want to make te theme work again...

It seems to be more a system update wich break the configuration as even when checkout to older commits (tested on those of february) the glyphs are not displayed properly.

Which version of font awesome is used for the theme ?

I also tried to install DejaVuSansMono via nerd-fonts install script but it does not resolve the issue (I don't think that a restart is needed but I didn't do it)

Last thing : I am on kubuntu with terminator as emulator while harrythedev is with osx

romkatv commented 5 years ago

@flohw This most likely has nothing to do with Powerlevel9k, Oh-My-Zsh or even ZSH. To narrow down the problem you can do the following.

  1. Start your terminal.
  2. Type bash.
  3. Type echo $'\uF015'.

If your terminal and font are set up correctly, you should see an icon of a house. If you see anything else, you need to figure our how to make it work. The best place to ask for help is the forum/mailing list/discussion board related to your terminal.

If the test above passes, type the same echo command but this time from ZSH without Powerlevel9k theme. If this also passes, and yet when you enable Powerlevel9k you don't see a house in your prompt when your are in your home directory, then it's an issue with Powerlevel9k and it's reasonable to ask for help here.

flohw commented 5 years ago

That's my point. My comment might not be clear about it.

Indeed, it's not a theme related problem. But it's strange that it appears after an update. terminator and konsole didn't display the icon and I am not very good at managing fonts on linux. I will try later. Thank you :slightly_smiling_face:

romkatv commented 5 years ago

I am not very good at managing fonts on linux.

Hence my practical advice above. Don't use non-standard symbols in your theme and then it'll work everywhere. No headaches with custom fonts.

RaitaroH commented 5 years ago

My case is very interesting. Oh-my-zsh with HACK nerd font MONO. I use mono due to the font being cut off. I use konsole 19.04.1. I also have hack nerd font mono under .fonts. I did try to move it to /usr/share/truetype/hack but it didn't really do anything.

TL;DR bash creates konsoles that show glyphs. zsh creates konsole that do not show glyphs.

image

So here is what is going on. This most likely is a konsole issue but I have no idea what the hell: Start konsole in bash. My default shell is bash but I like using zsh and I simply changed the startup command of konsole to /bin/zsh Everything is fine. echo $'\uF015' is fine. Now inside the shell run$ konsole Everything is fine. echo $'\uF015' is fine.

Start konsole with zsh. OR in the konsole with bash do $ zsh. By default my system will open konsole from bash, after that konsole will automatically run zsh. And now: Everything is fine. echo $'\uF015' is fine. Now inside the shell run $ konsole. Now we open a new konsole window from zsh. Every glyph ends up a question mark. I guess the .fonts folder is not seen or something. echo $'\uF015' is broken now. Running bash in this zsh shell will also end up broken. Funny enough though: ZSH > new brokwn konsole > ZSH > BASH > fine konsole

romkatv commented 5 years ago

If you run the following command from a working and a broken Konsole, is there a difference in the output?

env | grep -E 'LANG|LC_|TERM'
RaitaroH commented 5 years ago

@romkatv Kinda? image

romkatv commented 5 years ago

That's not it then. Perhaps when you type konsole you get a different binary in bash and zsh? Try using the full path instead, as in /path/to/konsole. Another thing you can try is to launch konsole with empty environment.

env -i /path/to/konsole

Does this give the same results from bash and zsh?

RaitaroH commented 5 years ago
$ whereis konsole                     
konsole: /usr/bin/konsole /usr/share/konsole

So using /usr/bin/konsole does not achieve anything. I get this:

qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: wayland-org.kde.kwin.qpa, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
[1]    16303 abort      env -i /usr/bin/konsole

And [1] 16303 abort env -i /usr/bin/konsole is zsh specific. In bash I get Aborted instead of this line.

romkatv commented 5 years ago

Do you get the same results when you execute /usr/bin/env -i /usr/share/konsole in bash and zsh? Just trying to eliminate potential sources of different behavior.

RaitaroH commented 5 years ago

@romkatv I just get /usr/bin/env: ‘/usr/share/konsole’: Permission denied because that is a folder. /usr/bin/env -i /usr/bin/konsole is same output.

romkatv commented 5 years ago

When you type konsole both in zsh and bash, konsole actually starts, right? You need to figure out how both shells resolve it because it might be different in zsh and bash.

To figure out how ZSH resolves konsole:

echo $commands[konsole]

If you copy the output of this command into bash and zsh, does it work the same way? What if you prefix it with /usr/bin/env -i?

P.S.

This remote debugging session doesn't seem productive, and this issue has nothing to do with Powerlevel9k, so I'll probably stop posting here to save your time and mine.

RaitaroH commented 5 years ago

Well yeah I have no idea what this is about it either. Nothing I tried seem to give any result so I said before hand this is most likely just a konsole issue. Even if it was a P9k problem then bash would work fine inside a broken konsole right? So echo a unicode character would be fine but that is not the case.

Also starting konsole from zsh is the problem, even if I use another terminal for that. If I start say terminator from zsh (regardless of emulator) terminator seems fine. I have installed terminator and urxvt just to test this. No issue anywhere. Is konsole after all :sweat:

Also: zsh: echo $commands[konsole] == /usr/bin/konsole bash: echo $commands[konsole] == [konsole]