zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Bug: reading from tty inside process substitution
Date: Tue, 14 Nov 2023 21:00:59 -0800	[thread overview]
Message-ID: <CAH+w=7Y6Tm=Ri4xTR_m4cEy3Sp+Be1Nx0B62Tj2mD8L8ObHtzQ@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7abshTC3bJC6YRJOszsyzJEHbBLYZafzdGd4p8J8LK5xg@mail.gmail.com>

A couple of other things about this ...

On Tue, Nov 14, 2023 at 8:42 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> On Tue, Nov 14, 2023 at 7:33 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
> >
> > > read foo < <(read bar; echo $bar) </dev/tty

The input of the process substitution is closed, so "read bar" does
nothing and "echo $bar" just prints a newline, which satisfies "read
foo".

However, the multio loop is still reading /dev/tty and won't discover
until its I/O buffers fill up that "read foo" isn't consuming any more
input.

> something is still ignoring TSTP (^z), perhaps because "read foo" is
> in the top-level interactive shell, so this can't be suspended.

The use of ESUB_NOMONITOR in the previous patch causes the multio loop
to ignore TSTP, so maybe there's another tweak to be done there, but I
think the reason the whole thing is not stop-able may be because "read
foo" has already finished.


  reply	other threads:[~2023-11-15  5:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-12 15:59 Mark J. Reed
2023-11-12 18:09 ` Bart Schaefer
2023-11-12 21:50   ` Bart Schaefer
2023-11-15  3:33   ` Bart Schaefer
2023-11-15  4:42     ` Bart Schaefer
2023-11-15  5:00       ` Bart Schaefer [this message]
2023-11-16  4:58         ` Bart Schaefer
2023-11-17  1:27           ` [PATCH] reading from large or "infinite" source in multio Bart Schaefer
2023-11-18 23:24             ` Bart Schaefer
2023-11-16  2:35       ` [PATCH] reading from tty inside process substitution 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='CAH+w=7Y6Tm=Ri4xTR_m4cEy3Sp+Be1Nx0B62Tj2mD8L8ObHtzQ@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).