Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: The elements of enlightenment
- X-seq: zsh-users 28510
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Ray Andrews <rayandrews@xxxxxxxxxxx>, zsh-users@xxxxxxx
- Subject: Re: The elements of enlightenment
- Date: Tue, 6 Dec 2022 21:01:30 +0100
- Archived-at: <https://zsh.org/users/28510>
- In-reply-to: <CAH+w=7ZNaobKgabqiCJb4VGwRGN0xfzG=RHtuUFMzf=Y8YQTkw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <54bcd6dd-e589-4696-f042-1155b78df9d2@eastlink.ca> <CAN=4vMp2r4Syu-CuF=gxed5om9JQ+NDQm6LvNZRBE4d5a4v1xw@mail.gmail.com> <819c9630-f315-8b1c-cb52-3d3ae8de2d5c@eastlink.ca> <CAN=4vMqKXudgwwQAPNzJ0OymhYWwPWu+ec+LyiVK2nhDP1jbeg@mail.gmail.com> <7eadf163-da34-d90b-61ce-b527fb75b597@eastlink.ca> <CAN=4vMq7=BGygpKU4ed_b33tdE0NGoCALZdaF10hz0co4zqksQ@mail.gmail.com> <37b2456f-0459-4b85-74d1-bb380715e2ed@eastlink.ca> <CAN=4vMp_LqvioJE_uW2_CwJ7CKL2dVwGn-6LMonPf_5pfngkzA@mail.gmail.com> <CAH+w=7ZNaobKgabqiCJb4VGwRGN0xfzG=RHtuUFMzf=Y8YQTkw@mail.gmail.com>
On Tue, Dec 6, 2022 at 8:45 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Dec 6, 2022 at 10:56 AM Roman Perepelitsa
> <roman.perepelitsa@xxxxxxxxx> wrote:
> >
> > That said, it's totally possible to extend zsh with something like $[
> > ... ] which would work like $( ... ) but without forking. It would run
> > the commands in another thread within the same process.
>
> That requires enabling support from threading libraries like pthreads,
> which bring along their own set of availability and synchronization
> challenges.
Yeah, it's probably non-trivial. Thankfully, it wouldn't require
inserting mutex locks in random places because the parent shell will
never be executing concurrently with the child. It'll be blocked while
the child is running. Signal handling might need changes though. I
don't know this part of the code well enough to know whether they
would be big or not.
I'm not suggesting that it's a good idea to implement $[ ... ]. I'm
just musing on the topic of capturing stdout from zsh code without
forking.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author