* Problems with escaped close parens in ternary expressions in PROMPT string
@ 1996-03-29 18:36 Joseph Goldstone
1996-03-29 21:21 ` Problems with escaped close parens in ternary expressions in PROMPT Zefram
0 siblings, 1 reply; 2+ messages in thread
From: Joseph Goldstone @ 1996-03-29 18:36 UTC (permalink / raw)
To: zsh-workers
I have my PROMPT variable set to:
PROMPT='%B%m%b%0(#. (root\).)%0(?.. (last code exit status was %?\)): '
When commands complete with a nonzero exit status, I get:
altair-4): foo
~
zsh: command not found: foo
altair-4 (last code exit status was 1\):
Whereas commands that complete with a zero exit status give me:
altair-4): echo foo ~
foo
altair-4):
~
I thought perhaps there's some reason why I would NOT have to escape the
first of the two adjacent closing parens, so I tried:
PROMPT='%B%m%b%0(#. (root\).)%0(?.. (last code exit status was %?)): '
With that change a nonzero exit status gives me:
altair-4): foo
~
zsh: command not found: foo
altair-4 (last code exit status was 1):
~
which is exactly what I want, but a zero exit status still gives me:
altair-4 (last code exit status was 1): echo foo
~
foo
altair-4):
~
I am presently seeing this on both NeXTSTEP 3.3 and IRIX 5.3, with both
systems running zsh 2.6-beta13.
This problem was not present on the IRIX 5.3 system before I upgraded the
zsh there to zsh-2.6beta13 -- it was running zsh-2.6-beta5 and didn't have
the problem. So has something changed in the ternary expression handling
code for PROMPT sequences since beta5 that would explain this problem?
Thanks.
--joseph
(ps: please email to me directly as I am no longer on zsh-users or zsh-workers.)
pps: the tilde characters you see are from RPROMPT='%B%U%~%u%b' -- that's
my homedir hanging out on the right hand edge of the screen, wrapping in
this email message.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Problems with escaped close parens in ternary expressions in PROMPT
1996-03-29 18:36 Problems with escaped close parens in ternary expressions in PROMPT string Joseph Goldstone
@ 1996-03-29 21:21 ` Zefram
0 siblings, 0 replies; 2+ messages in thread
From: Zefram @ 1996-03-29 21:21 UTC (permalink / raw)
To: Joseph Goldstone; +Cc: zsh-workers
In ternary expressions, close parens can no longer be escaped with \.
The \ is treated as a normal character, and the close paren ends the
ternary expression. You can get a literal ) by using the new %)
sequence. (If I were designing this from scratch, ) would be taken
literally, and %) would close the ternary. Unfortunately it's too late
for that; this solution breaks the least code.)
-zefram
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1996-03-29 21:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-03-29 18:36 Problems with escaped close parens in ternary expressions in PROMPT string Joseph Goldstone
1996-03-29 21:21 ` Problems with escaped close parens in ternary expressions in PROMPT Zefram
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).