zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [PATCH] [RFC] Reset pipestatus in zleread
Date: Fri, 12 Jan 2018 10:44:47 -0800	[thread overview]
Message-ID: <CAH+w=7Yy5nZ5f4kiS032cpgTtTNfszqHxT26h3piXQk02i3GOA@mail.gmail.com> (raw)
In-Reply-To: <20180111152211.18116-1-genml+zsh-workers@thequod.de>

On Thu, Jan 11, 2018 at 7:22 AM, Daniel Hahler
<genml+zsh-workers@thequod.de> wrote:
>
> I am looking at $pipestatus in my prompt precmd function, so that with
> "false | true" I would still get an indicator that (something in) the
> command failed (since $? (status) is 0 in this case).
>
> This patch resets it in zleread always.

In addition to what Eric noted, that's rather the wrong place to do
this.  Even if it solves the issue for interactive use (which it might
not), it doesn't make $pipestatus correct following assignments in
scripts.  This needs a deeper look (deeper than I have time for right
now).


      parent reply	other threads:[~2018-01-12 18:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11 15:22 Daniel Hahler
2018-01-11 17:16 ` Eric Cook
2018-01-12 18:44 ` Bart Schaefer [this message]

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='CAH+w=7Yy5nZ5f4kiS032cpgTtTNfszqHxT26h3piXQk02i3GOA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@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).