-
-
Save ryandaniels/c023044cb58568c406fa7a64a54d6c87 to your computer and use it in GitHub Desktop.
tmux autostart via ssh
This file contains hidden or 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
# .profile | |
... | |
# try to attach to tmux session or create a new one. | |
# Uncomment exit if you want to exit this session | |
# when tmux exits (e.g. detach) | |
if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then | |
tmux new-session -As "t-$USER-$(hostname -s)" | |
#exit | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment