Show exit status of the last executed command in ZSH prompt
We recently stumbled over the problem that we want to know the exit status of the last command that was executed in our ZSH. Well the obvious thing is echoing $?, but as we need this quite often we want to have it in our right prompt. Googling around a little bit, we found the solution:
In your .zshrc add the following line
This will give you the last exit status on the right site of your shell.
My zsh now looks like this (with the additional stuff)