Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zpty intermediate zsh process?
- X-seq: zsh-workers 47978
- From: Greg Klanderman <greg@xxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: zpty intermediate zsh process?
- Date: Tue, 09 Feb 2021 12:43:37 -0500
- Archived-at: <https://zsh.org/workers/47978>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-02/87o8gt2l2u.fsf%40lwm.klanderman.net>
- In-reply-to: <87v9b22ia1.fsf@lwm.klanderman.net> (Greg Klanderman's message of "Mon, 08 Feb 2021 19:31:50 -0500")
- List-id: <zsh-workers.zsh.org>
- References: <24606.56852.904076.773054@lwm.klanderman.net> <CAH+w=7YNN4JL6jUOUeWxojd+HsdVDRa8=UUU_JCrA-De34auDQ@mail.gmail.com> <87v9b22ia1.fsf@lwm.klanderman.net>
- Reply-to: Greg Klanderman <greg@xxxxxxxxxxxxxx>
>>>>> On February 8, 2021 Greg Klanderman <gak@xxxxxxxxxxxxxx> wrote:
>>>>> On February 6, 2021 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>> On Sat, Feb 6, 2021 at 10:21 AM Greg Klanderman <gak@xxxxxxxxxxxxxx> wrote:
>>>
>>> I can prefix the command with 'exec' to avoid that, but looking at the
>>> code in zpty.c, maybe the execode() call should just be setting the
>>> (third) 'exiting' argument to true?
>> That doesn't seem to cause any of the tests to fail, but I wonder
>> about side effects when traps are enabled, especially the EXIT trap.
> Hmm interesting, hadn't considered but I suppose the pty might even
> just be executing zsh code.. I suppose this is not worth changing if
> it might break desirable behavior.
>> Maybe just passing !sigtrapped[SIGEXIT] as the third argument would
>> suffice ... or maybe the handling of that trap by zpty is already
>> iffy.
> Reading zexit(), I suppose also "zshexit" and "zshexit_functions".
> What is
> runhookdef(EXITHOOK, NULL);
> ?
Relatedly, how would you feel about zpty returning the pid of the new
process in $!, like the zsh/clone module does?
Looks like it should just require adding
| lastpid = pid;
somewhere after the brace closing 'else if (!pid) { ...'
Greg
Messages sorted by:
Reverse Date,
Date,
Thread,
Author