Created
June 10, 2017 22:58
-
-
Save GongT/9dab130e611ba44c3af0ed7dc6be7c45 to your computer and use it in GitHub Desktop.
tmux wrapper. attach without arguments.
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
function tmux { | |
if [ $# -eq 0 ]; then | |
if /usr/bin/tmux list-sessions &>/dev/null ; then | |
/usr/bin/tmux attach | |
else | |
cd ~ | |
/usr/bin/tmux | |
fi | |
else | |
/usr/bin/tmux "$@" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment