Commits

James Tocknell  committed 283d04f

Fixed tmux starting

  • Participants
  • Parent commits a5403c5

Comments (0)

Files changed (1)

File .shell/login

 if [ -t 0 ]; then
     # Starts tmux if it exists
     if which tmux 2>&1 >/dev/null; then
-        #if not inside a tmux session, and if no session is started, start a new session
-        test -z "$TMUX" && (tmux attach || tmux new-session)
+        if [ -z "$TMUX"]; then
+            #if not inside a tmux session, and if no session is started, start a new session
+            if tmux has-session 2>&1 >/dev/null; then
+                exec tmux attach
+            else
+                exec tmux new-session
+            fi
+        fi
     fi
 fi