Skip to content

Instantly share code, notes, and snippets.

@rgruesbeck
Last active December 21, 2017 22:09
Show Gist options
  • Save rgruesbeck/ead07be89279027bc17029d672d47c7e to your computer and use it in GitHub Desktop.
Save rgruesbeck/ead07be89279027bc17029d672d47c7e to your computer and use it in GitHub Desktop.
tmux helper function that works well with teamocil
mux () {
# tmux helper function
templates="/home/ron/.teamocil/"
if [ -z $1 ]
then
echo "Sessions:"
tmux ls
echo ""
echo "Templates:"
ls $templates
else
tmux attach -t $1 || { [ -f "$templates/$1.yml" ] && tmux new-session teamocil $1 } || tmux new-session -s $1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment