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

stdbuf -o0 -i0 via a Zsh native interface?



Hi
I'm using coproc to continuously read command's output, to have the
effect of `CMD | fzf` – i.e. of instantly available contents while
reading all of it eventually, However, I've had problem with buffering
– no output from the CMD in `coproc CMD` was available for a long
time, and I've found that `coproc { stdbuf -o0 -i0 CMD; }` helps.

However, this is sub-optimal solution because I have to hideously
prepend the stdbuf command before each user CMD, meaning that entering
builtin commands will not work (e.g.: `stdbuf -i0 -o0 print smthg`).

I wonder if the infamous buffering problem, solved by the hacky
ld-preload stdbuf program could be fixed on the level of Zsh? Like,
e.g.: special array, say: zsh_buffer=( 0 0 0 )? For stdin, stdout and
stderr buffers.

-- 
Best regards,
Sebastian Gniazdowski




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