Skip to content

Instantly share code, notes, and snippets.

@omasanori
Last active September 8, 2019 05:14
Show Gist options
  • Save omasanori/0a24a204e15f08bc6d7660fc35451106 to your computer and use it in GitHub Desktop.
Save omasanori/0a24a204e15f08bc6d7660fc35451106 to your computer and use it in GitHub Desktop.
if [ -z "$TMUX" ] && [ -n "$SSH_TTY" ] && [[ $- =~ i ]]; then
tmux attach-session -t "$USER-ssh" 2> /dev/null || tmux new-session -s "$USER-ssh" || exit $?
exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment