* My zsh prompt
@ 2021-12-23 4:04 Duke Normandin
2021-12-23 4:40 ` Lawrence Velázquez
0 siblings, 1 reply; 8+ messages in thread
From: Duke Normandin @ 2021-12-23 4:04 UTC (permalink / raw)
To: zsh-users list
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. **
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: My zsh prompt
2021-12-23 4:04 My zsh prompt Duke Normandin
@ 2021-12-23 4:40 ` Lawrence Velázquez
2021-12-23 4:53 ` Duke Normandin
0 siblings, 1 reply; 8+ messages in thread
From: Lawrence Velázquez @ 2021-12-23 4:40 UTC (permalink / raw)
To: Duke Normandin; +Cc: zsh-users
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: My zsh prompt
2021-12-23 4:40 ` Lawrence Velázquez
@ 2021-12-23 4:53 ` Duke Normandin
2021-12-23 5:11 ` Lawrence Velázquez
0 siblings, 1 reply; 8+ messages in thread
From: Duke Normandin @ 2021-12-23 4:53 UTC (permalink / raw)
To: zsh-users
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. **
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: My zsh prompt
2021-12-23 4:53 ` Duke Normandin
@ 2021-12-23 5:11 ` Lawrence Velázquez
2021-12-23 5:18 ` Duke Normandin
0 siblings, 1 reply; 8+ messages in thread
From: Lawrence Velázquez @ 2021-12-23 5:11 UTC (permalink / raw)
To: Duke Normandin; +Cc: zsh-users
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: My zsh prompt
2021-12-23 5:11 ` Lawrence Velázquez
@ 2021-12-23 5:18 ` Duke Normandin
2021-12-23 6:28 ` Lawrence Velázquez
0 siblings, 1 reply; 8+ messages in thread
From: Duke Normandin @ 2021-12-23 5:18 UTC (permalink / raw)
To: larryv; +Cc: zsh-users list
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. **
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: My zsh prompt
2021-12-23 5:18 ` Duke Normandin
@ 2021-12-23 6:28 ` Lawrence Velázquez
2021-12-23 20:26 ` Daniel Shahaf
0 siblings, 1 reply; 8+ messages in thread
From: Lawrence Velázquez @ 2021-12-23 6:28 UTC (permalink / raw)
To: Duke Normandin; +Cc: zsh-users
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: My zsh prompt
2021-12-23 6:28 ` Lawrence Velázquez
@ 2021-12-23 20:26 ` Daniel Shahaf
2021-12-23 20:46 ` Duke Normandin
0 siblings, 1 reply; 8+ messages in thread
From: Daniel Shahaf @ 2021-12-23 20:26 UTC (permalink / raw)
To: Lawrence Velázquez; +Cc: zsh-users, Duke Normandin
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: My zsh prompt
2021-12-23 20:26 ` Daniel Shahaf
@ 2021-12-23 20:46 ` Duke Normandin
0 siblings, 0 replies; 8+ messages in thread
From: Duke Normandin @ 2021-12-23 20:46 UTC (permalink / raw)
To: zsh-users list
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 **
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-12-23 20:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-23 4:04 My zsh prompt Duke Normandin
2021-12-23 4:40 ` Lawrence Velázquez
2021-12-23 4:53 ` Duke Normandin
2021-12-23 5:11 ` Lawrence Velázquez
2021-12-23 5:18 ` Duke Normandin
2021-12-23 6:28 ` Lawrence Velázquez
2021-12-23 20:26 ` Daniel Shahaf
2021-12-23 20:46 ` Duke Normandin
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).