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 21:21, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> Use with great caution, but to test the concept:
>
> TRAPDEBUG() { setopt err_exit; stdbuf -o0 -i0 ${(z)ZSH_DEBUG_CMD} }

Interesting, I've never touched debug trap, this gives me a glimpse of
how it is working.

And as for the topic in general, I've had a moment of understanding
that what's needed is basically: a `stdbuf` command that's *built-in*,
and this comes down  to your idea of `STTY=… my-cmd` -like
inline-export variable, which is a nicer, more integrated version of a
stdbuf-clone builtin (and could be made non-only-inline-export, to set
once and forget). Now, who has time to look at stdbuf.c? :) To grasp
what the LD-trick used there is?

-- 
Best regards,
Sebastian Gniazdowski




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