Created
May 27, 2014 07:32
-
-
Save fzerorubigd/aa7d26eb7e9152bb13d5 to your computer and use it in GitHub Desktop.
Attach to any old TMUX on exit if its not a tty (only in pty and anything else)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TMUX | |
if [ -z `tty | grep tty` ] ; then | |
if which tmux 2>&1 >/dev/null; then | |
# if no session is started, start a new session | |
test -z ${TMUX} && tmux | |
# when quitting tmux, try to attach | |
while test -z ${TMUX}; do | |
tmux attach || break | |
done | |
fi; | |
fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment