zsh-users
 help / color / mirror / code / Atom feed
From: "Michał Politowski" <mpol@charybda.icm.edu.pl>
To: zsh-users@sunsite.dk
Subject: Re: $? being clobbered?
Date: Mon, 14 Jul 2003 19:57:27 +0200	[thread overview]
Message-ID: <20030714175727.GA19238@Amber.lab.icm.edu.pl> (raw)
In-Reply-To: <20030714173555.GA4352@mithrandir.aperiodic.net>

On Mon, 14 Jul 2003 13:35:56 -0400, Phil!Gregory wrote:
> I'm having a problem with zsh, and am not sure if it's a bug or a
> feature.  If I have a program executed in my prompt, its return status
> clobbers the value of $?, which isn't really what I want.  Example:
> 
> > PROMPT='> '
> > perl -e 'exit 42'
> > echo $?
> 42
> > PROMPT='%{$(echoti cub 80)%}> '
> > perl -e 'exit 42'
> > echo $?
> 0
> 
> Is there some way to fix this?

You can hack around this with
$(R=$?;echoti cub 80;return $R)

-- 
Michał Politowski -- mpol@charybda.icm.edu.pl
Warning: this is a memetically modified message


  reply	other threads:[~2003-07-14 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-14 17:35 Phil!Gregory
2003-07-14 17:57 ` Michał Politowski [this message]
2003-07-14 19:25 ` Bart Schaefer
2003-07-14 19:51   ` Phil!Gregory

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=20030714175727.GA19238@Amber.lab.icm.edu.pl \
    --to=mpol@charybda.icm.edu.pl \
    --cc=zsh-users@sunsite.dk \
    /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).