Open Tmux on ssh login
June 24, 2019
Here is few lines you need to add to your .bashrc/.zshrc/.whatevershellrc:
if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then tmux attach-session -t mysession || tmux new-session -s mysession fi
These lines check if tmux session
mysession is exist then we
is executed. Otherwise new session with
mysession name is created.
mysession to something more meaningful.