Last active
September 8, 2019 05:14
-
-
Save omasanori/0a24a204e15f08bc6d7660fc35451106 to your computer and use it in GitHub Desktop.
Launch tmux(1) automatically when logged in via SSH. See https://stackoverflow.com/questions/27613209/how-to-automatically-start-tmux-on-ssh-session
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
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