From 77e9a05e9c29b9b544b61ba0744775ed7f9b84a0 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Wed, 23 Sep 2015 22:10:35 +0100 Subject: [PATCH] Add the launch of tmux, if available. --- .bashrc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.bashrc b/.bashrc index 6c7ecc0..0fab668 100644 --- a/.bashrc +++ b/.bashrc @@ -75,3 +75,17 @@ for FILE in ~/.bash/auto_complete.d/*; do source ${FILE}; done #-------------------------------------------------------------------------------- [ -f ~/.bashrc_local ] && source ~/.bashrc_local + +#-------------------------------------------------------------------------------- +# Launch tmux, if available +#-------------------------------------------------------------------------------- +if which tmux &> /dev/null; then + if ! tmux attach &> /dev/null; then + if [[ ! $TERM =~ screen ]]; then + exec tmux + fi + else + exit + fi +fi +#--------------------------------------------------------------------------------