Fix tmux autostart

This commit is contained in:
Marko Korhonen 2022-09-03 12:31:38 +03:00
parent 44d1ccc82d
commit 4df4bc914f
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890

View file

@ -1,6 +1,10 @@
# Launch tmux if logging in over ssh
if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then
exec tmux attach-session -t ssh_tmux || exec tmux new-session -s ssh_tmux
if tmux has-session &2>/dev/null; then
exec tmux attach-session -t ssh_tmux
else
exec tmux new-session -s ssh_tmux
fi
fi
# share history between running zsh instances