]> git.huck.website - zshmux.git/commitdiff
Vim quick push
authorHuck Boles <huboles@protonmail.com>
Sun, 25 Sep 2022 01:03:27 +0000 (20:03 -0500)
committerHuck Boles <huboles@protonmail.com>
Sun, 25 Sep 2022 01:03:27 +0000 (20:03 -0500)
zshmux.zsh

index 137333d910c537fa6b8cd15977db4912dfb950cd..68b14d3797cc71b8f804b56eb487d1777b184e75 100644 (file)
@@ -1,16 +1,16 @@
 #!/bin/zsh
 
 if [[ -z $TMUX ]]; then
-    if tlist &> /dev/null ; then
-        printf 'Current tmux sessions:\n\n'
-        tlist
+    if tmux list-sessions &> /dev/null ; then
+        printf 'Current tmux sessions:\n'
+        tmux list-sessions -F"#S - (#{?session_attached,Attached,Not Attached})"
     else
         printf '\nNo tmux sessions active\n'
     fi
-    printf '\n\tAttach session?: [name] (empty if none): '
+    printf 'Attach session?: [name] (empty if none): '
     read response
     if [ -n "$response" ]; then
-        if tlist | grep -q "$response"; then
+        if tmux list-sessions | grep -q "$response"; then
             tmux attach-session -t $response 
         else
             tmux new-session -s $response