new (zprofile): add automatic mechanism to start or reattach a tmux when connecting onto a remote server

This commit is contained in:
eeemsi 2024-11-09 09:52:14 +01:00
parent 447a7e8ecd
commit 124d7bc71b

5
zprofile Normal file
View File

@ -0,0 +1,5 @@
# Start or reattach a tmux session when a ssh connection is established
if [[ -n "${SSH_CONNECTION}" ]] && [[ "${TERM}" != "tmux-256color" ]]; then
tmux attach-session -d || tmux new-session
exit
fi