简体   繁体   中英

Zshell starting with an error (showed in Powerline9k-theme)

Recently I installed Zshell instead of Bash. During this, then I saw that my $PATH was 7 miles long, - so I decided to try and clean it up a bit. When I uninstalled rvm (by running rvm implode followed by rm -rf ~/.rvm ) then when I restarted my terminal, I now see an error:

zshell powerline9k错误

If I just press ENTER , then the error remains. But if I do any other command, then it disappears ( ls , echo , source ~/.zshrc - you name it).

zshell powerline9k错误2

If I reboot iTerm (or start a new tab), - then the error re-appears.

The error is not being showed, - so if I activate another theme, then I can't see if there is an error.

My gut feeling tells me, that it has something to do with my path, but I'm not sure. My path is waaay shorter than before RVM was installed.

If i rename my ~/.zshrc -file, then the Powerline9k -theme gets deactivated, so I can't see if the error actually still appears or not. But I have tried it... Then a theme-less zshell just start up.

Any idea how to fix it or how to debug it?

EDIT

I just realized that it could actually have been a left-over-error, from back when I was running bash, - so I added that tag as well.

Have look at their documentation on github, relevant fragment is here .

Solution:

In your ~/.zshrc find variable called POWERLEVEL9K_LEFT_PROMPT_ELEMENTS and remove rbenv .

Explanation:

The default value of POWERLEVEL9K_LEFT_PROMPT_ELEMENTS is (context dir rbenv vcs) , and it is likely that rbenv is the segment producing the error - after you uninstalled rvm that segment can't execute.

If the visual blemish disappears as soon as you execute any command as you say so, just place an echo -n at the end of your .zshrc as a quick and easy fix, if you are not up to the task of debugging and potentially causing more problems on your machine.

The issue isn't worth your time ;)

Edit: Apparently the above didn't work. See comments.

If you are interested in debugging, a good starting point would be to place set -xe (print every line that is executing and abort on any line that exits nonzero) at the beginning (after the shebang line, or as flags in the shebang) of each configuration script that is executed when you start a new interactive shell.

Also consider set -xeuo pipefail to additionally catch and abort on usage of unset shell variables and commands that return nonzero inside pipes (eg set -e will not abort on false | true because the overall line exited with status 0 , but -o pipefail will abort on such a line). It is worth noting that these flags are bash features, but since zsh is a feature superset of bash , they work in zsh too.

Uninstall all apps that use the path and reinstall. It's the only way. Instead of rm, you use should create an alias that has a trash can.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM