tmux-plugin-sysstat
tmux-plugin-sysstat copied to clipboard
stdbuf and mawk cause an extremely long delay in CPU usage updates
On a system, where mawk is the default awk instead of gawk (for example, Raspbian Stretch), the following will fail to give any output until all the samples are produced. For default settings, this will cause a delay of 60x10 seconds between CPU usage updates.
https://github.com/samoshkin/tmux-plugin-sysstat/blob/29e150f403151f2341f3abcb2b2487a5f011dd23/scripts/cpu_collect.sh#L30-L31
I propose two solutions:
- Replace
awkwith/usr/bin/gawkeverywhere in the code and listgawkas a dependency. - Adapt the code so that
stdbufandmawkcan produce streaming output.