Skip to content

Instantly share code, notes, and snippets.

@GongT
Created June 10, 2017 22:58
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 GongT/9dab130e611ba44c3af0ed7dc6be7c45 to your computer and use it in GitHub Desktop.
Save GongT/9dab130e611ba44c3af0ed7dc6be7c45 to your computer and use it in GitHub Desktop.
tmux wrapper. attach without arguments.
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