Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: stdbuf -o0 -i0 via a Zsh native interface?



On Thu, 25 May 2023 at 18:36, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Thu, May 25, 2023 at 7:16 AM Peter Stephenson
> <p.w.stephenson@xxxxxxxxxxxx> wrote:
> >
> > > On 25/05/2023 12:21 Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
> >
> > Something like this?  It looks like a good fit for zsystem.
>
> That's a start, but it doesn't solve Sebastian's problem of having to
> hack the stdbuf prefix into the command string for external commands.

I think that it does solve the problem, if the buffer settings are
applied to external commands. I would say that they are, but your
answer gives doubts… are they applied?

Also, I wonder why the buffers can be set only to 0, 1 and 2 and not
to every descriptor? This might be an effect of suggestion from my
original post, but the mechanism of a builtin command obtaining file
descriptor opens my eyes that buffers can be changed on every
descriptor (or not?).

> We'd need something akin to the STTY parameter to specify a prefix for
> external commands.  That might have its own security concerns.

That's an interesting approach, however IMHO it would make the
mechanism's interface script-targeted, and not foreground, interactive
work (because of the need of prepend command each time with a var export).


--
Best regards,
Sebastian Gniazdowski




Messages sorted by: Reverse Date, Date, Thread, Author