From a756a9fa7edaf0e3021cd0d18fbebe2223baeef6 Mon Sep 17 00:00:00 2001 From: Asmir A Date: Sun, 19 Nov 2023 12:09:51 +0100 Subject: [PATCH] home/zsh: execute tmux on ssh --- home/zsh.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/home/zsh.nix b/home/zsh.nix index 4ba9c48..c56583b 100644 --- a/home/zsh.nix +++ b/home/zsh.nix @@ -99,6 +99,10 @@ eval "$(direnv hook zsh)" zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' + + if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then + tmux attach-session -t $USER || tmux new-session -s $USER + fi ''; }; }