about summary refs log tree commit diff stats
path: root/nix-conf/home/includes
diff options
context:
space:
mode:
Diffstat (limited to 'nix-conf/home/includes')
-rw-r--r--nix-conf/home/includes/zsh.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/nix-conf/home/includes/zsh.nix b/nix-conf/home/includes/zsh.nix
index 7fdb666..c9d8926 100644
--- a/nix-conf/home/includes/zsh.nix
+++ b/nix-conf/home/includes/zsh.nix
@@ -81,7 +81,7 @@
     };
 
     initExtra = ''
-      # Taken from prezto tmux plugin
+      # Based on prezto tmux plugin
       if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && (-z "$SSH_TTY" || -n "$TMUX_AUTO_ATTACH") ]]; then
         tmux start-server
 
@@ -89,7 +89,11 @@
           tmux new-session -d -s "0" \; set-option -t "0" destroy-unattached off &> /dev/null
         fi
 
-        exec tmux -u attach-session -d
+        if [[ -n "$SSH_TTY" ]]; then
+          exec tmux -u attach-session
+        else
+          exec tmux -u attach-session -d
+        fi
       fi
 
       export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow -g "!{.git,node_modules}/*" 2> /dev/null'