Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: sysexits.h codes? (was: Re: [RFC][PATCH] `newuser` prompt theme)
On Tue, May 4, 2021 at 2:13 PM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> I've given it some more thought and the best option, I think, would be
> as follows:
> * Have an associative array $sysexits.
> * Let the keys be the return codes and the values be the exact
> descriptions that PRINT_EXIT_VALUE shows (minus the 'zsh: ' prefix and
> command suffix, of course).
> * Include all of 0 (success), 1 (failure), 2 (error), 64 - 78
> (sysexits.h), 126 (command not executable), 127 (command not found),
> and 129 - 159 (signal.h). (Anything else I'm forgetting?)
> * $sysexits could either be built in, like $signals, or be available
> through a module.
>
> Additional features for consideration:
> * Make $sysexits editable, so that you can modify what PRINT_EXIT_VALUE outputs.
> * Let PRINT_EXIT_VALUE support formatting in the form of prompt escape
> sequences.
Actually, I think it would be pretty nice to have something like
$TIMEFMT but for exit codes. And adding support to both of these for
prompt escape sequences would be great. :)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author