Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

When I load zsh, my theme will not work and I get ".zshrc:92: command not found: print_icon" #695

Closed
mohamed-elmashad opened this issue Dec 10, 2017 · 16 comments
Labels

Comments

@mohamed-elmashad
Copy link

mohamed-elmashad commented Dec 10, 2017

When I load zsh, my powerlevel9k custom theme will not work and I get ".zshrc:92: command not found: print_icon"

@djetelina
Copy link
Contributor

Here are some previous issues about your problem:

#313
#510
#543

So try fixing locale/make sure you're not calling it somewhere you shouldn't.

@mohamed-elmashad
Copy link
Author

mohamed-elmashad commented Dec 12, 2017

How do I fix it? When I run locale, it prints LANG=en_US.UTF8 LANGUAGE=en.UTF-8 LC_CTYPE=en_US.UTF-8 LC_NUMERIC="en_US.UTF8" LC_TIME="en_US.UTF8" LC_COLLATE="en_US.UTF8" LC_MONETARY="en_US.UTF8" LC_MESSAGES="en_US.UTF8" LC_PAPER="en_US.UTF8" LC_NAME="en_US.UTF8" LC_ADDRESS="en_US.UTF8" LC_TELEPHONE="en_US.UTF8" LC_MEASUREMENT="en_US.UTF8" LC_IDENTIFICATION="en_US.UTF8" LC_ALL=

@bhilburn
Copy link
Member

It's possible your $LANG is malformed. I believe it is supposed to be LANG="en_US.UTF-8" - note the hyphen between UTF and 8. Try this at the top of your zshrc: export LANG=en_US.UTF-8

@mohamed-elmashad
Copy link
Author

mohamed-elmashad commented Dec 15, 2017

Sadly, that did not fix it. Here is my zshrc file: https://pastebin.com/VKJLPxkq

@djetelina
Copy link
Contributor

Okay so exactly like #543 - you have print_icon in your .zshrc, which loads before functions/icons.zsh, if I understand #543 correctly

@mohamed-elmashad
Copy link
Author

How do I fix this? Thanks

@bhilburn
Copy link
Member

@Apple61752 - Check out the link that @iScrE4m posted. There is a comment that describes how to fix it: #543 (comment)

You are making calls to print_icon before you have sourced Oh My Zsh. You need to run OMZ before you can reference print_icon in your zshrc

@bhilburn
Copy link
Member

Hey @Apple61752 - We haven't heard back from you, so I'm going to go ahead and close this. If you are still having issues, feel free to re-open!

@mohamed-elmashad
Copy link
Author

what is OMZ @bhilburn

@detygon
Copy link

detygon commented Nov 12, 2018

Hi! This is a wonderful theme. Great work. I didn't have any issue using the theme but I get this error when I activate a python virtual environment using pipenv shell.

@dritter
Copy link
Member

dritter commented Nov 13, 2018

@mrdionjr On which branch/version of P9K are you? And can you show us your configuration?

@detygon
Copy link

detygon commented Nov 13, 2018

I guess the latest version! I've just followed the instructions on the README. I use Oh My Zsh. I left most of the default settings. Here is my configuration

ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_MODE="awesome-patched"
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon user dir dir_writable vcs)
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2

before_pipenv
after_pipenv

@detygon
Copy link

detygon commented Nov 13, 2018

I just noticed that it happens everytime I enter in a subshell. I tried to record the terminal session using termtosvg it I got the same error.

@dritter
Copy link
Member

dritter commented Nov 13, 2018

@mrdionjr Thanks for the Screenshot. Your problem is already adressed in #587 and will be fixed soon. For now you can set a valid utf-8 locale as LC_CTYPE.

@detygon
Copy link

detygon commented Nov 13, 2018

It's already set. Here is the output of locale:

locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=en_GB.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=en_GB.UTF-8
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

@detygon
Copy link

detygon commented Nov 13, 2018

I've solved the issue by exporting LANG and LC_ALL:

export LANG=en_GB.UTF-8
export LC_ALL=""

I think it was due to LANG being overwritten somewhere. Thanks for your support.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants