zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Weird issue with pipeviewer and multiple pipes
Date: Fri, 6 May 2016 22:35:20 +0100	[thread overview]
Message-ID: <20160506223520.34b3e3c4@ntlworld.com> (raw)
In-Reply-To: <CAH+w=7b+tKnvfv1ip6ykNW4Oh_BQSiXnGwGMQzhvfi=Wrq6DXg@mail.gmail.com>

On Tue, 3 May 2016 20:56:14 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
>On Tue, May 3, 2016 at 6:15 PM, Jaron L Tibbitts III <tibbs@math.uh.edu> wrote:
> >
> > [2]  + 11459 done                    echo 1 |
> >        11461 suspended (tty output)  pv -l -s $(echo 1) |
> >        11462 interrupt               cat
> 
> I don't know why the $(echo) makes any
> difference to it receiving the TTOU in the first place.

Actually, it looks like This Can't Possibly Happen, since $(echo 1) is
over and done with by the time the pv is started; we've got the output,
closed the fd, and waited for the process to finish (by PID).  So there
is some weird lingering side effect.
 
> All of these also avoid the problem:
> 
>     echo 1 | { trap '' TTOU ; pv -p -s $(echo 1) } | cat
>     echo 1 | pv -p -s $(echo 1) 2>/dev/tty | cat
>     echo 1 | { x=$(echo 1); pv -p -s $x } | cat

Also, a substitution of the form $(<file) doesn't do it, either.  That's
probably not surprising as there's no extra process there, but it does
leave not that much code in getoutput() to be causing it.  I tried
commenting out entersubsh() to see if the terminal handling in there
maede a difference, but it didn't.  In fact, even pruning down
the behaviour in the child to simply printing something didn't
have any effect.

pws


  parent reply	other threads:[~2016-05-06 21:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04  1:15 Jason L Tibbitts III
2016-05-04  3:56 ` Bart Schaefer
2016-05-05 15:14   ` Peter Stephenson
2016-05-05 15:26     ` Bart Schaefer
2016-05-06 21:35   ` Peter Stephenson [this message]
2016-05-06 21:55     ` Bart Schaefer

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=20160506223520.34b3e3c4@ntlworld.com \
    --to=p.w.stephenson@ntlworld.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).