Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Prompt exit code return



Hello there.
This is my $PS1 var:
PS1='%(?.%F{green}.%F{red})%#%f '
So it is green if exit code is 0 and red if it is not...
So when exit code != 0 , it is red no matter how much you hit return..
I want for %# to be red if exit code != 0 only after the command is
finished,and then after I hit return it is green again...I was thinking
there could be a postcmd() like precmd but that wouldn't work would it?
Thanks in advance


Messages sorted by: Reverse Date, Date, Thread, Author