Development discussion for mrsh.

You can setup your Git repository like so:

git config sendemail.to ~emersion/mrsh-dev@lists.sr.ht

Re: Issues with job control and nested shell processes

Details
Message ID
<iQ2PdNlTAv2aNFj_KxquSr213wxTigbFrJILIQ-MK4mnTDcxBI6YeG7r2tW9uzavAj-et2fPp-E4J_NOc4ksgkB0UoW7KZUwotWZ8-7_DjE=@emersion.fr>
Sender timestamp
1559758745
DKIM signature
pass
Download raw message
On Wednesday, June 5, 2019 9:14 PM, Drew DeVault <sir@cmpwn.com> wrote:
> On Wed Jun 5, 2019 at 6:12 PM Simon Ser wrote:
>
> > Hmm. So, I'm not sure whether this is an optimization that dash
> > implements or whether this is really required by the spec.
>
> Well, I would assume that if I did this:
>
> some-task &
> kill $!
>
> That the signal would be delivered to some-task, not to a mrsh process.

The signal will be delivered to the mrsh process group. The child
processes are part of the same process group. mrsh will ignore the
signal, but child processes still receive it.

> > Basically, the issue is that the `&` is represented very high in the
> > POSIX shell AST. So the job that needs to be run may actually need that
> > extra shell process, for instance if the asynchronous command contains
> > `&&` or `|`:
>
> dash doesn't spawn a subshell in these cases, either :<

It does seem to do it like mrsh:

$ sleep 999 && sleep 999 &

> pstree -a 20447
dash
  └─dash
      └─sleep 9999