Skip to content

Instantly share code, notes, and snippets.

@alecthegeek
Forked from Pitometsu/tmux_manager.sh
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alecthegeek/fa7a010c4229eb436366 to your computer and use it in GitHub Desktop.
Save alecthegeek/fa7a010c4229eb436366 to your computer and use it in GitHub Desktop.
#!/bin/bash
# manage Tmux
if [ -n "$TMUX" ]; then # in tmux
if [ -n "$COLORTERM" ]; then # in rich VT
export TERM=xterm-256color-italic
fi
elif tmux list-sessions > /dev/null 2>&1 ; then
tmux attach # try to attach
else
tmux # just start new tmux
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment