Skip to content

Instantly share code, notes, and snippets.

@kclejeune
Created July 30, 2021 04:06
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 kclejeune/ee7337cfd18750dff724a60883be3941 to your computer and use it in GitHub Desktop.
Save kclejeune/ee7337cfd18750dff724a60883be3941 to your computer and use it in GitHub Desktop.
tmux auto config for hpc over ssh
# if we're in an interactive ssh shell and NOT in a tmux shell, reconnect or create an ssh_tmux session
if [[ $- == *i* ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
# tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux
tmux new-session -A -s ssh_tmux
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment