tmux-plugin-sysstat icon indicating copy to clipboard operation
tmux-plugin-sysstat copied to clipboard

Make cpu_collect compatible with OSX and use gstdbuf

Open aaronlna opened this issue 7 years ago • 5 comments

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 g prefixed gstdbuf on OSX as to not require modifying the user PATH.
  • Modify refresh_interval and samples_count to complete two samples of iostat per TMUX status line refresh.

aaronlna avatar Jun 24 '18 14:06 aaronlna

This fixed the issue for me. Thank you!

chris-vest avatar Aug 03 '18 14:08 chris-vest

Will this pr be merged?

hit9 avatar Oct 21 '18 13:10 hit9

brew install coreutils gets me gstdbuf installed.

And then CPU outputs ok.

hit9 avatar Oct 21 '18 13:10 hit9

@samoshkin please merge this

kleinjm avatar Dec 01 '18 14:12 kleinjm

@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.

h0adp0re avatar Nov 29 '21 14:11 h0adp0re