Zsh includes the ability to display the return code/exit code of the previous command in the prompt by using the %? escape sequence.
%?
However I would like to
Alternatively, you can:
setopt PRINT_EXIT_VALUE
to always print a newline showing previous return value.
I don't prefer this for ordinary use, but it is often good for debugging shell scripts.