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

Re: My zsh prompt



Lawrence Velázquez wrote on Thu, 23 Dec 2021 06:28 +00:00:
> On Thu, Dec 23, 2021, at 12:18 AM, Duke Normandin wrote:
>> Hopefully zshmisc has a list of those return statuses.
>
> It doesn't, as the shell does not determine the exit statuses of
> external utilities.  Beyond the general convention of zero for
> success and nonzero otherwise, utilities dictate their own statuses,
> so it's up to you to consult the appropriate documentation.
>
> (The zshbuiltins(1) man page documents notable exit statuses for
> builtins.)

In addition to the zero/non-zero convention, there are:

- A process killed by a signal exits with 128+$signal.  That's why
  Lawrence guessed the <130> was the exit code (130-128 is SIGINT)..

- There's sysexits.h, but not everyone uses it.  However, one could
  argue that zsh should recognize those and print messages similar to
  the messages it prints for processes killed by signals.

Cheers,

Daniel




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