zsh-users
 help / color / mirror / code / Atom feed
From: Klaus Ethgen <klaus+usenet@ethgen.de>
To: zsh-users@zsh.org
Subject: Strange prompt behaviour with %?
Date: Wed, 16 Oct 2019 15:31:33 +0100	[thread overview]
Message-ID: <slrnqqeae9.49l.klaus+usenet@ikki.ethgen.de> (raw)

Hi folks,

I have a very strange behaviour.

I have set:
   PS1="%{$fg_no_bold[$_usercolor]%}%m: %{$fg_bold[blue]%}?%(?.%{$fg_no_bold[green]%}.%{$fg_bold[red]%})%?%2(L. %{$fg_bold[blue]%}#%{$fg_bold[magenta]%}%L.) %{$fg_bold[blue]%}!%{$fg_bold[magenta]%}%h%1(j. %{$fg_bold[blue]%}j%{$fg_bold[magenta]%}%j.)%E
%{$fg_bold[blue]%}%60<..<%~%<<\${vcs_info_msg_0_}> %{$reset_color%}"

I want to have an eye on the part
'%{$fg_bold[blue]%}?%(?.%{$fg_no_bold[green]%}.%{$fg_bold[red]%})%?'.

When I execute "perl -e 'exit 2;'" several times, I get sometimes a 0
and sometimes a 2. (The same with "/bin/false" but there it doesn't seem
to be wrong that often.

Does anybody have an explanation for this behaviour?

-- Klaus
-- 
Klaus Ethgen                                       http://www.ethgen.ch/
pub  4096R/4E20AF1C 2011-05-16            Klaus Ethgen <Klaus@Ethgen.ch>
Fingerprint: 85D4 CA42 952C 949B 1753  62B3 79D0 B06F 4E20 AF1C


                 reply	other threads:[~2019-10-16 15:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slrnqqeae9.49l.klaus+usenet@ikki.ethgen.de \
    --to=klaus+usenet@ethgen.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).