Last Updated: February 25, 2016
·
720
· 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

#!/bin/bash
/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.

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

Guarding a web app includes the code that arrives in the browser, not only the code in source control. Tags and dependencies can change in production between deploys.

Security insights from Cside