Use exec to replace current shell with tmux instead of forking

This commit is contained in:
Marko Korhonen 2022-09-03 12:24:59 +03:00
parent f781e4b0c9
commit 76b50dbe6f

View file

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