From 124d7bc71bbab12a601edd7b816359ee3f583663 Mon Sep 17 00:00:00 2001 From: eeemsi Date: Sat, 9 Nov 2024 09:52:14 +0100 Subject: [PATCH] new (zprofile): add automatic mechanism to start or reattach a tmux when connecting onto a remote server --- zprofile | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 zprofile diff --git a/zprofile b/zprofile new file mode 100644 index 0000000..3d305c2 --- /dev/null +++ b/zprofile @@ -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