Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: What's a superjob?
- X-seq: zsh-workers 43582
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: What's a superjob?
- Date: Fri, 28 Sep 2018 17:06:08 +0200
- In-reply-to: <CAH+w=7ZyUS0F+74t0wrD-vKJiDWt0QypsRQGaS1njRiLTscZHg@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20180926153149epcas3p1a817e8295570aa23ef107f7ecb95f980@epcas3p1.samsung.com> <1537975883.2212216.1521491576.1CF7021B@webmail.messagingengine.com> <20180926155055eucas1p2a9eeba9267adcb603fbd609e47780010~X-fvU7i_h1255912559eucas1p2q@eucas1p2.samsung.com> <CAH+w=7ZyUS0F+74t0wrD-vKJiDWt0QypsRQGaS1njRiLTscZHg@mail.gmail.com>
On 2018-09-26 10:42:00 -0700, Bart Schaefer wrote:
> On Wed, Sep 26, 2018 at 8:51 AM Peter Stephenson
> <p.stephenson@xxxxxxxxxxx> wrote:
> >
> > Now we have just one process running: the main shell, and vi. Suppose
> > you hit ^Z. Then vi suspends. The main shell is in the middle of
> > running e, but it's not supposed to finish doing that till vi exits.
> > But without special action we're now back at the top-level shell prompt
> > and it never will execute.
>
> To add a bit more color here ... in the absence of this special
> handling, when vi is suspended, the shell has two choices:
> 1) treat vi as successfully completed and continue executing the function, or
> 2) treat vi as failed and stop the function at this point.
>
> IIRC different shells have historically made different decisions about
> this. I believe zsh's original behavior was #1, but that led to
> problems if (in this type of example) the remainder of the function
> depends on the content of the edited file. So #2 avoids side-effects,
> but causes at minimum annoyance because now you have a suspended vi
> but the rest of the function is simply gone.
But if the goal of the rest of the function is to modify the current
shell environment, this is just like if it were gone. Couldn't zsh
avoid the extra fork and immediately ask the user what to do?
For instance: continue in foreground (avoiding the extra fork),
do the extra fork, interrupt the function in some way.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author