Powerlevel9k: command not found: print_icon on iTerm2

Created on 8 Jun 2017  ·  5Comments  ·  Source: Powerlevel9k/powerlevel9k

Hi guys,

been working for a couple of days with powerlevel9k and it's really awesome! the only thing I cannot get away with is the error above, which is caused by:
POWERLEVEL9K_DIR_PATH_SEPARATOR="%F{red} $(print_icon 'LEFT_SUBSEGMENT_SEPARATOR') %F{black}"

in my .zshrc file.
Found around that the problem may be caused by locale not being correctly set, so I changed it to the following:

LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

and restarted iTerm2. I keep getting the error and don't know where to fix it. Anyone with Mac OS Sierra and iTerm2 in the same situation?
Any help is much appreciated!

Most helpful comment

You are right, but you can make it work by open a subshell and print the icon there:
bildschirmfoto 2017-06-09 um 23 23 35
Copy&Paste solution:
POWERLEVEL9K_DIR_PATH_SEPARATOR="%F{white} $(print $'\uE0B1') %F{white}"

All 5 comments

Hi @guidoilbaldo !

Glad you like the theme. :)

The error comes from calling print_icon too early (before the theme is loaded, and print_icon is available).

There are two quick fixes:

  1. Make sure you call the theme before you call print_icon. This is a bit stupid, because you have to keep a specific order..
  2. You replace the print_icon call with the right code point for LEFT_SUBSEGMENT_SEPARATOR (which depends on your font).

So I recommend the latter method. Just look up the right code point in functions/icons.zsh.

Hope that helps.

Had no luck changing this line with your suggestion:
POWERLEVEL9K_DIR_PATH_SEPARATOR="%F{white} \uE0B1 %F{white}"
With the above conf, it just prints \uE0B1 string between folder icon and path.

You are right, but you can make it work by open a subshell and print the icon there:
bildschirmfoto 2017-06-09 um 23 23 35
Copy&Paste solution:
POWERLEVEL9K_DIR_PATH_SEPARATOR="%F{white} $(print $'\uE0B1') %F{white}"

great! Thanks again dritter for your patience :) I'll close this!

Thanks for the great support, @dritter =)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mingrammer picture mingrammer  ·  4Comments

iiison picture iiison  ·  3Comments

natemccurdy picture natemccurdy  ·  5Comments

OATOMO picture OATOMO  ·  4Comments

xufab picture xufab  ·  4Comments