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

Re: reinventing print_exit_value



Christian Taylor wrote:

> I recently decided that I want the exit code of the last command (if it's 
> greater than 0) displayed after invoking it, like the PRINT_EXIT_VALUE option 
> does, but in my own format. (I don't want to include it in my prompt.)

Actually, you _do_ want to include it in your prompt.  Simply use

%(?..status: %?)

in your prompt, and it will only be displayed when there's something to
display (non-zero exit value in this case),
        nikolai

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}



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