Search code examples
zshiterm2oh-my-zsh

Why does iTerm2 / oh-my-zsh starts with an error? Where should I start looking?


Question edit: What are the places I should look to try to debug this?

I use iTerm2 with oh-my-zsh. At the beginning it worked perfectly, but since few weeks it starts with an error. Note the ↑1:

Last login: Mon Sep 30 21:04:35 on ttys000
↑1 ~ →

Here is the screenshot : Error highlighted

Do you have any idea why that happens or how could I look for the cause?

Note. I have the same setup at work, but that issue never occurred. I must have done something wrong on my personal machine and I am unable to see the cause.


Solution

  • I've finally found the problem. It was in ~/.zshrc. At the end of the file there were 3 serverless commands:

    113 # tabtab source for serverless package
    114 # uninstall by removing these lines or running `tabtab uninstall serverless`
    115 [[ -f /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/serverless.zsh ]] && . /usr/local/lib    /node_modules/serverless/node_modules/tabtab/.completions/serverless.zsh
    116 # tabtab source for sls package
    117 # uninstall by removing these lines or running `tabtab uninstall sls`
    118 [[ -f /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/sls.zsh ]] && . /usr/local/lib/node_m    odules/serverless/node_modules/tabtab/.completions/sls.zsh
    119
    120 # tabtab source for slss package
    121 # uninstall by removing these lines or running `tabtab uninstall slss`
    122 [[ -f /Users/costin/node_modules/tabtab/.completions/slss.zsh ]] && . /Users/costin/node_modules/tabtab/.completion    s/slss.zsh
    

    All these three commands fail with exit code 1. By commenting them the error disappears.

    As an answer I was expecting to be oriented to look for failing commands in ~/.zshrc and maybe some other similar files.