Everything working OK! Just curious about: [prompt] ┌─(~)───────────────────────────────────────────(dnormandin@antixbox)─ └─› <130> [/prompt] The <130> at the right of this prompt. What is that? Total commands for the session? -- Duke ** Text only please. Bottom post is best for me. **
On Wed, Dec 22, 2021, at 11:04 PM, Duke Normandin wrote:
> Everything working OK!
> Just curious about:
>
> [prompt]
> ┌─(~)───────────────────────────────────────────(dnormandin@antixbox)─
> └─› <130>
> [/prompt]
>
> The <130> at the right of this prompt. What is that? Total commands
> for the session?
Without context or code, no one can tell you how your own prompt
works. Presumably you got it from a framework or plugin system or
code you copypasted from the Web.
As an educated guess, it sure looks like $?. Try running some
commands and observing how it changes.
--
vq
On Wed, 22 Dec 2021 23:40:23 -0500 Lawrence Velázquez <larryv@zsh.org> wrote: > On Wed, Dec 22, 2021, at 11:04 PM, Duke Normandin wrote: > > Everything working OK! > > Just curious about: > > > > [prompt] > > ┌─(~)───────────────────────────────────────────(dnormandin@antixbox)─ > > └─› > > <130> [/prompt] > > > > The <130> at the right of this prompt. What is that? Total > > commands for the session? > > Without context or code, no one can tell you how your own prompt > works. prompt_kir.zsh => https://controlc.com/06817c16 -- Duke ** Text only please. Bottom post is best. **
On Wed, Dec 22, 2021, at 11:53 PM, Duke Normandin wrote:
> prompt_kir.zsh => https://controlc.com/06817c16
Okay, the relevant bit is this --
RPS1="%(?..%B%F{red}<%?>%f%b)"
-- specifically ''%?'', which is described in zshmisc(1).
%? The return status of the last command executed just before
the prompt.
--
vq
On Thu, 23 Dec 2021 00:11:34 -0500
Lawrence Velázquez <larryv@zsh.org> wrote:
> On Wed, Dec 22, 2021, at 11:53 PM, Duke Normandin wrote:
> > prompt_kir.zsh => https://controlc.com/06817c16
>
> Okay, the relevant bit is this --
>
> RPS1="%(?..%B%F{red}<%?>%f%b)"
>
> -- specifically ''%?'', which is described in zshmisc(1).
>
> %? The return status of the last command executed just before
> the prompt.
Muchas gracias! Hopefully zshmisc has a list of those return
statuses.
Thanks again and Feliz Navidad!!!
--
Duke
** Text only please. Bottom post is best. **
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.) > Feliz Navidad!!! Likewise! -- vq
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
On Thu, 23 Dec 2021 20:26:32 +0000
"Daniel Shahaf" <d.s@daniel.shahaf.name> wrote:
> 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.
Noted! Thx ...
--
Duke
** Text only please. Bottom post is best for me **