about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--nix-conf/home/edrahil.nix4
-rw-r--r--nix-conf/home/includes/zsh.nix2
2 files changed, 5 insertions, 1 deletions
diff --git a/nix-conf/home/edrahil.nix b/nix-conf/home/edrahil.nix
index b871056..3e39dd3 100644
--- a/nix-conf/home/edrahil.nix
+++ b/nix-conf/home/edrahil.nix
@@ -12,6 +12,10 @@
   home.username = "djm";
   home.homeDirectory = "/home/djm";
 
+  home.sessionVariables = {
+    TMUX_AUTO_ATTACH=1;
+  };
+
   # This value determines the Home Manager release that your
   # configuration is compatible with. This helps avoid breakage
   # when a new Home Manager release introduces backwards
diff --git a/nix-conf/home/includes/zsh.nix b/nix-conf/home/includes/zsh.nix
index f08b299..95a8b1f 100644
--- a/nix-conf/home/includes/zsh.nix
+++ b/nix-conf/home/includes/zsh.nix
@@ -75,7 +75,7 @@
 
     initExtra = ''
       # Taken from prezto tmux plugin
-      if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && -z "$SSH_TTY" ]]; then
+      if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && (-z "$SSH_TTY" || -n "$TMUX_AUTO_ATTACH") ]]; then
         tmux start-server
 
         if ! tmux has-session 2> /dev/null; then