2

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 error

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 error-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.

Zeth
  • 2,273
  • 4
  • 43
  • 91

3 Answers3

2

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.

boojum
  • 669
  • 2
  • 9
  • 31
  • Good guess, - but that wasn't it. I tried removing all the `PROMPT_ELEMENTS`, but left and right (except for the `status`), - and it still gave me the error. – Zeth Aug 10 '17 at 19:52
2

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 (e.g. 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.

JoshuaRLi
  • 1,665
  • 14
  • 23
  • The `echo -n` didn't solve it for me (and neither did `echo -n '\n'`). I tried inserting `set -xe` in my `.zshrc`-file and that was amazing! I can see on line two, that it writes this: `Last login: Thu Aug 10 21:45:40 on ttys000 +/Users/[USERNAME]/.zlogin:2> [[ -s /Users/[USERNAME]/.rvm/scripts/rvm ]]`... Where can I find, where that's coming from? That directory doesn't exist anymore (the `.rvm` one). I tried running a `grep -nr 'rvm' /*` but that didn't find anything I could use... – Zeth Aug 10 '17 at 19:54
  • @Zeth That line tests to see if that file exists and is greater than zero size, and since it doesn't exist on your computer anymore, it is returning a nonzero exit code, which is what your powerline is detecting. – JoshuaRLi Aug 10 '17 at 20:07
  • @Zeth I have no experience with ruby, but my guess is that the `rvm` installation inserted that into your `.zlogin` file. Simply removing that line from `.zlogin` should fix your problem! – JoshuaRLi Aug 10 '17 at 20:08
  • You were right!! And by running `grep -nr '.rvm/scripts/rvm' /*` I could see that it was Dreamweaver who was responsible for that call. No more errors for me! – Zeth Aug 10 '17 at 20:44
  • 1
    Glad I could help, thanks for the bounty! If you come across any future hiccups with shell scripts, those debug flags are certainly very helpful. – JoshuaRLi Aug 10 '17 at 20:49
0

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.

  • That is 'the safe' way to do it - yes. But it annoys me to have a terminal that can show me that there is an error of some sort, - but not what that error is. So I'd rather find out, how to 'interpret' what my terminal is telling me, instead of ripping it out with it's roots and replant it and hope that it'll never do any such thing again.. – Zeth Aug 07 '17 at 06:21