zsh-workers
 help / color / mirror / code / Atom feed
From: Rudi C <rudiwillalwaysloveyou@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>,
	Rudi C <rudiwillalwaysloveyou@gmail.com>,
	 "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [Bug] Unexpected process suspension
Date: Thu, 21 May 2020 03:02:03 +0430	[thread overview]
Message-ID: <CAE9z9A2pR_HhLgKox-txROinnkJnS=s5s9DyZo9ZJs9BYGAyKw@mail.gmail.com> (raw)
In-Reply-To: <20200513062902.gf6e22g4sqni75x4@chazelas.org>

[-- Attachment #1: Type: text/plain, Size: 2247 bytes --]

Considering this bug (or a very similar variant) was reported before and
the issue just died a silent death, I think it's a good idea to create a
Github repo for tracking zsh issues. Github issue tracker is a lot better
than mailing lists, as things have a dichotomy of being  open/closed, and
can be labeled. It is harder for issues to die a silent death there. It is
also easier to contribute to that, and easier to unsubscribe (I don't think
one can unsubscribe from a mailing list post one participated in, as people
(wisely) use reply-all.).

On Wed, May 13, 2020 at 10:59 AM Stephane Chazelas <stephane@chazelas.org>
wrote:

> 2020-05-12 10:38:38 -0700, Bart Schaefer:
> > On Tue, May 12, 2020 at 12:03 AM Rudi C <rudiwillalwaysloveyou@gmail.com>
> wrote:
> > >
> > > mdoc-test () {
> > >
> > >     sleep 0 | sleep 0
> > >     cat}
> > >
> > > echo start |VISUAL=vim command vipe|mdoc-test
> > >
> > > # zsh: suspended (tty output)
> >
> > Putting an interactive command in the middle of a pipeline is
> > generally not going to work.  Vim in particular is pretty aggressive
> > about trying to grab a terminal, which will result in processes
> > getting SIGTT* because they don't have foreground control of the
> > terminal they're trying to use.
> [...]
>
> The thing is vim *should* be in the foreground, all the
> processes started in pipeline should be in the same process
> group which should be in foreground (so it gets
> SIGINT/SIGQUIT/SIGTSTP upon ^C/^\/^Z, so it can read the
> terminal, etc) but under some circumstances, zsh fails to put
> some processes in that group, which is a bug.
>
> $ </proc/self/stat awk '{print $5, $8}' >&2
> 127235 127235
> $ </proc/self/stat awk '{print $5, $8; system("exec sleep 1")}'  >&2 | ps
> -o pid,pgid,comm
> 131569 131569
>     PID    PGID COMMAND
>  124948  124948 zsh
>  131569  131569 awk
>  131570  131569 ps
>  131571  131569 sleep
> $ </proc/self/stat awk '{print $5, $8}' >&2 | { :; }
> 127410 127410
> $ </proc/self/stat awk '{print $5, $8}' >&2 | { : | :; }
> 127496 124948
>
> In that latter case, awk is in a different process group
> (127496) from the terminal foreground process group (124948
> which here is the process group of the main shell process!).
>
> --
> Stephane
>

  reply	other threads:[~2020-05-20 22:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12  7:02 Rudi C
2020-05-12 11:48 ` Daniel Shahaf
2020-05-12 11:53   ` Roman Perepelitsa
2020-05-12 11:57     ` Daniel Shahaf
2020-05-12 12:05       ` Roman Perepelitsa
2020-05-12 13:31     ` Stephane Chazelas
2020-05-12 17:38 ` Bart Schaefer
2020-05-13  6:29   ` Stephane Chazelas
2020-05-20 22:32     ` Rudi C [this message]
2020-05-21  3:33       ` A bug tracker (was: Re: [Bug] Unexpected process suspension) Daniel Shahaf
2020-05-21  4:44         ` Bart Schaefer
2020-05-21 13:39         ` Oliver Kiddle
2020-05-21 16:46           ` Daniel Shahaf

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='CAE9z9A2pR_HhLgKox-txROinnkJnS=s5s9DyZo9ZJs9BYGAyKw@mail.gmail.com' \
    --to=rudiwillalwaysloveyou@gmail.com \
    --cc=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).