tmux-plugin-sysstat
tmux-plugin-sysstat copied to clipboard
Make cpu_collect compatible with OSX and use gstdbuf
https://github.com/samoshkin/tmux-plugin-sysstat/issues/5
Environment
- OSX Sierra 10.12.6
- zsh 5.2 (x86_64-apple-darwin16.0)
- coreutils: stable 8.29 (bottled)
Problems
iostat intervals are buffered-- even while using stdbuf-- until all intervals are complete. This makes the cpu_collect script not update the statusline for TMUX as a refresh happens before all intervals are completed (ie. nothing gets written to the corresponding tmp file).
Changes
- Use the
gprefixedgstdbufon OSX as to not require modifying the user PATH. - Modify refresh_interval and samples_count to complete two samples of
iostatper TMUX status line refresh.
This fixed the issue for me. Thank you!
Will this pr be merged?
brew install coreutils gets me gstdbuf installed.
And then CPU outputs ok.
@samoshkin please merge this
@samoshkin please consider merging this. Currently I (and probably many others) have resorted to using aaronlna/tmux-plugin-sysstat but it'd be nice to use the main project.