Powerlevel9k: Print warning about `locale` (was: Commands not found)

Created on 5 Jun 2016  Â·  25Comments  Â·  Source: Powerlevel9k/powerlevel9k

I originally had the issue cover in issue #264. I applied the patch from the comments in issue #264 which solved that problem. However, now it runs but I get "command not found" errors for almost everything in the theme.

left_prompt_segment:4: command not found: segmentShouldBeJoined
left_prompt_segment:26: command not found: isSameColor
left_prompt_segment:4: command not found: segmentShouldBeJoined
left_prompt_segment:20: command not found: isSameColor
left_prompt_segment:24: command not found: print_icon
left_prompt_segment:44: command not found: print_icon
prompt_vcs:33: command not found: print_icon
prompt_vcs:34: command not found: print_icon
prompt_vcs:36: command not found: defined
prompt_vcs:38: command not found: defined
prompt_vcs:42: command not found: print_icon
left_prompt_end:2: command not found: print_icon
left_prompt_end:6: command not found: print_icon
build_right_prompt:1: command not found: defined
right_prompt_segment:5: command not found: segmentShouldBeJoined
right_prompt_segment:23: command not found: isSameColor
right_prompt_segment:32: command not found: print_icon
right_prompt_segment:5: command not found: segmentShouldBeJoined
right_prompt_segment:23: command not found: isSameColor
right_prompt_segment:32: command not found: print_icon

I'm running Gallium OS and zsh 5.0.7

Most helpful comment

Hah! I am finally able to reproduce this error.
I set up a virtual machine with a basic arch linux. I had to do some modifications to the test-vm/bootstrap.sh, as arch uses pacman instead of apt-get..

After I logged in to that machine, I got the following screen:
bildschirmfoto 2016-06-14 um 23 50 21

As you can see, the locale was set to C, which destroys the theme. Think we should print out at least a warning..

After setting LANG=en_US.UTF8 at the very beginning of my ~/.zshrc, all was fine. :)

All 25 comments

I have the same error:
left_prompt_segment:24: command not found: print_icon left_prompt_segment:44: command not found: print_icon prompt_vcs:33: command not found: print_icon prompt_vcs:34: command not found: print_icon prompt_vcs:42: command not found: print_icon left_prompt_end:2: command not found: print_icon left_prompt_end:6: command not found: print_icon right_prompt_segment:32: command not found: print_icon right_prompt_segment:38: command not found: print_icon right_prompt_segment:32: command not found: print_icon right_prompt_segment:32: command not found: print_icon

Hi @monteros and @lyinch . Thanks for the report. I have some questions for you:

  • Do you use any ZSH framework? If yes, which one is it?
  • Did you get the warning to set POWERLEVEL9K_INSTALLATION_PATH manually?
  • Does it help, if you set POWERLEVEL9K_INSTALLATION_PATH to your installation folder?

We recently changed the way how powerlevel9k find its libraries. The error messages are exactly what happens, if these libraries are not found.

@lyinch Do you have ZSH 5.0.7 as well?

Anything new on this issue? I am getting this error too.
Maybe you just forgot to check/mention the dependencies of this theme?

@Xiaoming94 Could you provide some more informations about your setup?

My Config for powerlevel9k:
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=""
POWERLEVEL9K_MULTILINE_SECOND_PROMPT_PREFIX="\U2570\U2500 $ "
POWERLEVEL9K_DIR_HOME_BACKGROUND="cyan"
POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND="magenta"
POWERLEVEL9K_CONTEXT_DEFAULT_BACKGROUND='121'
POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND='black'

Running Archlinux with Linux kernel 4.6.2
ZSH version: 5.2

Do you want my installed packages too?

Thank you very much.
Installed packages would be too much, I think.

Do you use Prezto? Or any other ZSH framework?
And how do you source/link/activate the theme?

I use Oh-My-Zsh

That really should not happen.. I'll have a look on that.

Sorry, I didn't see this traffic until now. I'm using prezto. No errors
with other themes.

On Sat, Jun 11, 2016 at 7:04 AM, Dominik Ritter [email protected]
wrote:

That really should not happen.. I'll have a look on that.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/bhilburn/powerlevel9k/issues/272#issuecomment-225356753,
or mute the thread
https://github.com/notifications/unsubscribe/ARpuT3VBdR0kkAEIaQIFF0zuww1zYaSrks5qKqRngaJpZM4IuT9x
.

I'm sourcing per prezto using zstyles and placing in the ./modules/
directory. I'm currently using nicoulaj as my theme.

With a fresh clone of the repo and following the install for prezto I now
get the following error:

Usage: prompt
Options:
-c Show currently selected theme and parameters
-l List currently available prompt themes
-p [] Preview given themes (defaults to all)
-h [] Display help (for given theme)
-s Set and save theme
Switch to new theme immediately (changes not saved)

Use prompt -h for help on specific themes.

The previous errors no longer appear.

Where should I set the path? Setting it at the beginning of the
powerlevel9k.theme does not change anything. THe same error as above
appears.

On Sat, Jun 11, 2016 at 3:12 PM, Guillermo Monteros <[email protected]

wrote:

Sorry, I didn't see this traffic until now. I'm using prezto. No errors
with other themes.

On Sat, Jun 11, 2016 at 7:04 AM, Dominik Ritter [email protected]
wrote:

That really should not happen.. I'll have a look on that.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/bhilburn/powerlevel9k/issues/272#issuecomment-225356753,
or mute the thread
https://github.com/notifications/unsubscribe/ARpuT3VBdR0kkAEIaQIFF0zuww1zYaSrks5qKqRngaJpZM4IuT9x
.

Please disregard the above. That's something else in my config. Let me
figure that out and I'll report back.

On Sat, Jun 11, 2016 at 3:45 PM, Guillermo Monteros <[email protected]

wrote:

I'm sourcing per prezto using zstyles and placing in the ./modules/
directory. I'm currently using nicoulaj as my theme.

With a fresh clone of the repo and following the install for prezto I now
get the following error:

Usage: prompt
Options:
-c Show currently selected theme and parameters
-l List currently available prompt themes
-p [] Preview given themes (defaults to all)
-h [] Display help (for given theme)
-s Set and save theme
Switch to new theme immediately (changes not saved)

Use prompt -h for help on specific themes.

The previous errors no longer appear.

Where should I set the path? Setting it at the beginning of the
powerlevel9k.theme does not change anything. THe same error as above
appears.

On Sat, Jun 11, 2016 at 3:12 PM, Guillermo Monteros <
[email protected]> wrote:

Sorry, I didn't see this traffic until now. I'm using prezto. No errors
with other themes.

On Sat, Jun 11, 2016 at 7:04 AM, Dominik Ritter <[email protected]

wrote:

That really should not happen.. I'll have a look on that.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/bhilburn/powerlevel9k/issues/272#issuecomment-225356753,
or mute the thread
https://github.com/notifications/unsubscribe/ARpuT3VBdR0kkAEIaQIFF0zuww1zYaSrks5qKqRngaJpZM4IuT9x
.

I'm also using prezto, altough I'm using zgen as well. My loading up is as follows:

source ~/.zgen/zgen.zsh
if ! zgen saved; then
    # Bootstrap fonts

    # Load skwp theme, in case powerlevel9k doesn't work.
    zgen prezto prompt theme 'skwp'
    zgen prezto syntax-highlighting color 'yes'

    # prezto and modules
    zgen prezto

    zgen prezto git
    zgen prezto command-not-found
    zgen prezto syntax-highlighting
    zgen prezto history-substring-search
    zgen prezto completion
    zgen prezto fasd

    zgen load tarruda/zsh-autosuggestions
    if [[ ! $TERM =~ linux ]];
    then
        zgen load bhilburn/powerlevel9k powerlevel9k.zsh-theme
    fi

    prompt skwp
fi

Maybe doing something similiar would work for you?

Figured out the prompt command issue. Apparently you can't comment out at
the end of a line. 'nicoulaj'#'powerlevel9k' gets turned into
'nicoulaj#powerlevel9k' when parsed.

With the path set I get the following error now:
Script location could not be found!

This is the end of my trace from starting up:
+is-at-least:36> (( part < min_ver[min_cnt] ))
+is-at-least:36> return 1
+prompt_powerlevel9k_setup:30> [[ -f
/home/user/.zprezto/modules/prompt/init.zsh ]]
+prompt_powerlevel9k_setup:32>
0=/home/user.zprezto/modules/prompt/functions/prompt_powerlevel9k_setup
+prompt_powerlevel9k_setup:53> [[ -L prompt_powerlevel9k_setup ]]
+prompt_powerlevel9k_setup:56> [[ -f prompt_powerlevel9k_setup ]]
+prompt_powerlevel9k_setup:60> print -P '%F{red}Script location could not
be found!%f'
Script location could not be found!
+prompt_powerlevel9k_setup:61> return 1
+prompt:5> (( 0 ))
+prompt:8> true
unset prompt_argv
+/home/user/.zprezto/modules/prompt/init.zsh:18> unset prompt_argv
+pmodload:35> (( 0 == 0 ))
+pmodload:36> zstyle :prezto:module:prompt loaded yes
unset pmodules
+/home/user/.zprezto/init.zsh:115> unset pmodules

On Sat, Jun 11, 2016 at 3:52 PM, Guillermo Monteros <[email protected]

wrote:

Please disregard the above. That's something else in my config. Let me
figure that out and I'll report back.

On Sat, Jun 11, 2016 at 3:45 PM, Guillermo Monteros <
[email protected]> wrote:

I'm sourcing per prezto using zstyles and placing in the ./modules/
directory. I'm currently using nicoulaj as my theme.

With a fresh clone of the repo and following the install for prezto I now
get the following error:

Usage: prompt
Options:
-c Show currently selected theme and parameters
-l List currently available prompt themes
-p [] Preview given themes (defaults to all)
-h [] Display help (for given theme)
-s Set and save theme
Switch to new theme immediately (changes not saved)

Use prompt -h for help on specific themes.

The previous errors no longer appear.

Where should I set the path? Setting it at the beginning of the
powerlevel9k.theme does not change anything. THe same error as above
appears.

On Sat, Jun 11, 2016 at 3:12 PM, Guillermo Monteros <
[email protected]> wrote:

Sorry, I didn't see this traffic until now. I'm using prezto. No errors
with other themes.

On Sat, Jun 11, 2016 at 7:04 AM, Dominik Ritter <
[email protected]> wrote:

That really should not happen.. I'll have a look on that.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/bhilburn/powerlevel9k/issues/272#issuecomment-225356753,
or mute the thread
https://github.com/notifications/unsubscribe/ARpuT3VBdR0kkAEIaQIFF0zuww1zYaSrks5qKqRngaJpZM4IuT9x
.

@monteros You seem to use the master branch. That shouldn't be a problem, I mention it because we did some improvements for locating the script on the next branch..
For prezto we have to do some assumptions, as there is no good way to find the script location prior to ZSH 5.0.8. One of these assumptions is that you link powerlevel9k theme to ~/.zprezto/modules/prompt/functions/prompt_powerlevel9k_setup as described in the wiki. We check for existence of that file, and try to find the original installation folder. If we fail to find the original installation folder, you get the "Script location could not be found" error.

What seems odd in your trace is this line:

+prompt_powerlevel9k_setup:32>
0=/home/user.zprezto/modules/prompt/functions/prompt_powerlevel9k_setup

It looks like there is a slash missing (/home/user.zprezto/...). Could you post the output of

print -P "${ZDOTDIR:-$HOME}/.zprezto/modules/prompt/functions/prompt_powerlevel9k_setup"
ls -l "${ZDOTDIR:-$HOME}/.zprezto/modules/prompt/functions/prompt_powerlevel9k_setup"

@Xiaoming94 I have a hard time reproducing this problem under ZSH 5.2 and with the next branch. So I need to ask some more general questions.

Oh-my-zsh provides a mechanism to easily add functionality. One could add own themes under ~/.oh-my-zsh/custom/themes. We advise people to clone the powerlevel9k repo under this directory. I guess, you've installed powerlevel9k with the archlinux package manager pacman, right?

Pacman follows the instructions from a PKGBUILD file. Although this file seems valid (it also copies our files in the functctions folder), you may have an outdated version. Could you post the contents of /usr/share/zsh-theme-powerlevel9k/functions/?

Same error, fresh arch + ohmyzsh.

left_prompt_segment:24: command not found: print_icon16:14 
left_prompt_segment:44: command not found: print_icon
prompt_vcs:33: command not found: print_icon
prompt_vcs:34: command not found: print_icon
prompt_vcs:42: command not found: print_icon
left_prompt_end:2: command not found: print_icon
left_prompt_end:6: command not found: print_icon
right_prompt_segment:32: command not found: print_icon
right_prompt_segment:38: command not found: print_icon
right_prompt_segment:32: command not found: print_icon
right_prompt_segment:38: command not found: print_icon
right_prompt_segment:32: command not found: print_icon
right_prompt_segment:32: command not found: print_icon

I am on master branch. I installed the package by cloning the repo into ~/.oh-my-zsh/custom/themes as said in the wiki. Here are the content of my functions folder:
$ ls functions colors.zsh icons.zsh utilities.zsh vcs.zsh

@Xiaoming94 Could you edit powerlevel9k.zsh-theme and add the following line at line 50:

print -P "SCRIPT: $0"

And open a new terminal and post the output of the line?

Ok, I don't know what the hell happened, but it seems like the error is gone... somehow... I just installed some packages... openssh, apache, mariadb, php, npm, ruby, nodejs and so on... weird.

Also, looks like I didn't set my LANG variable first, witch it is now. Maybe has something to do with that?

@Xiaoming94 - Very interesting! Can you try unsetting LANG to see if it breaks it again? I'm glad it's working for you, and thanks so much for helping us debug it!

@xPathin - Is your LANG env variable set?

Sorry, can't answer anymore i reformatted the faulty system and use bash now on it.

@xPathin - Hah, fair enough.

@Xiaoming94 - Any chance you can try that experiment?

Hah! I am finally able to reproduce this error.
I set up a virtual machine with a basic arch linux. I had to do some modifications to the test-vm/bootstrap.sh, as arch uses pacman instead of apt-get..

After I logged in to that machine, I got the following screen:
bildschirmfoto 2016-06-14 um 23 50 21

As you can see, the locale was set to C, which destroys the theme. Think we should print out at least a warning..

After setting LANG=en_US.UTF8 at the very beginning of my ~/.zshrc, all was fine. :)

@dritter - Great find! It seems like the locale setting has caused us a number of problems in the past. I agree with your suggestion of adding a warning to print if it's set incorrectly.

Leaving this bug open as a reminder to add that.

New warning about $LANG is now printed as of 4666bd49.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

natemccurdy picture natemccurdy  Â·  5Comments

shibumi picture shibumi  Â·  5Comments

iiison picture iiison  Â·  3Comments

guidoilbaldo picture guidoilbaldo  Â·  5Comments

davidmpaz picture davidmpaz  Â·  3Comments