]> git.huck.website - zshmux.git/commitdiff
Quick add bug fixes v1.0
authorHuck Boles <huboles@protonmail.com>
Mon, 26 Sep 2022 03:50:36 +0000 (22:50 -0500)
committerHuck Boles <huboles@protonmail.com>
Mon, 26 Sep 2022 03:50:36 +0000 (22:50 -0500)
zshmux.zsh

index e87c974b12e5fff6dbe32d25215e0e95384cc9d0..3bb46349d7d3c1e5d72c4499ba880fa679ef47e2 100644 (file)
@@ -2,10 +2,10 @@
 
 if [[ -z $TMUX ]]; then
         
-    if tmux list-sessions &> /dev/null ; then
+    if [[ $(tmux list-sessions | wc -l) -ne 0 ]]; then
 
         if [[ $(tmux list-sessions -F"#{?session_attached,,x}" | grep "x" | wc -l) -eq 1 ]]; then
-            tmux attach-session -t $(tmux list-sessions -F"#S")
+            tmux attach-session -t $(tmux list-sessions -F"#{?session_attached,,#S}"  )
             return
         else
             printf '\033[32;1mCurrent \033[33;1mtmux \033[32;1msessions\033[0m:\n'