auto launch tmux on ssh

This commit is contained in:
vincent 2021-02-09 19:08:51 +01:00
parent 1e4b5d6001
commit fd74f0fd91

View File

@ -16,6 +16,15 @@ else
eval `dircolors ~/.dircolors/dircolors.ansi-dark`
fi
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
#launch tmux on ssh connection
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux
fi
if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s`
fi