Skip to content

Instantly share code, notes, and snippets.

@pgib
Last active December 27, 2015 01:29
Show Gist options
  • Save pgib/7245288 to your computer and use it in GitHub Desktop.
Save pgib/7245288 to your computer and use it in GitHub Desktop.
export TERM="screen-256color"
if tty -s; then
if [ -z "$WINDOW" ]; then
if tmux has-session -t devops; then
echo -n "tmux found. Re-attach? [Y/n]: "
read response
case $response in
N*|n*)
echo "Okay. Type 'tmux attach' later..."
;;
*)
tmux attach
;;
esac
else
echo -n "Should we start up tmux? [Y/n]: "
read response
case $response in
N*|n*)
echo "Okay. Type 'tmux new-session -t devops' later..."
;;
*)
tmux new-session -t devops
;;
esac
fi
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment