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

Strange prompt behaviour with %?



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