Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Strange prompt behaviour with %?
- X-seq: zsh-users 24351
- From: Klaus Ethgen <klaus+usenet@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Strange prompt behaviour with %?
- Date: Wed, 16 Oct 2019 15:31:33 +0100
- Cancel-lock: sha1:K6fQybM8F/rezRtcM9h7mEbcGDU=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: The wild Jungle
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@xxxxxxxxx>
Fingerprint: 85D4 CA42 952C 949B 1753 62B3 79D0 B06F 4E20 AF1C
Messages sorted by:
Reverse Date,
Date,
Thread,
Author