Last Updated: February 25, 2016
· ksi

Use guard (rails) with clearing tmux pane

The Guardfile has one option

clearing :on

which, if set, clears the screen before starting a new run. However, using tmux and guard in a special pane, this satisfies only less because of the history buffer tmux brings.

Add a new shell script in the path, e. g. ~/bin/clear

/usr/bin/clear && [[ -z "$TMUX ]] || tmux clear-history

and make it executable. Now the above mentioned setting will also clear your history buffer for that pane if you're in tmux.