]> git.huck.website - zshmux.git/commitdiff
now with color
authorHuck Boles <huboles@protonmail.com>
Sun, 25 Sep 2022 01:15:46 +0000 (20:15 -0500)
committerHuck Boles <huboles@protonmail.com>
Sun, 25 Sep 2022 01:15:46 +0000 (20:15 -0500)
README.md
zshmux.zsh

index 888c7b5ebef7e588f074aae8b51bcc6df30e644b..f3970ee1d6a42a59f5bb479812ee46c5090100a0 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,10 +1,11 @@
 # zshmux
 
 If a new shell is launched, *zshmux* quickly checks if there are any tmux sessions, or if the current shell is already in a tmux instance.
-If you are not already in a tmux session *zshmux* will ask if you want to attach a currently running session, or make a new session in the shell.
+If you are not already in a tmux session *zshmux* will list all currently active sessions, and ask if you want to attach a currently running session, or make a new session in the shell.
 
 ## How to use:
 -Clone this repository: `git clone https://github.com/huboles/zshmux`
 
 -Source *zshmux* in your .zshrc: `source <path-to-zshmux>/zshmux/zshmux.zsh`
 
+-Open a new shell
index 3e9d9cfdb67fd125f4b6107b80e1cdb976173c62..2dc7b493efd1dd4a64127c7d85988e9a5d2da598 100644 (file)
@@ -8,12 +8,12 @@ if [[ -z $TMUX ]]; then
         printf '\n\033[34;1mNo \033[33;1mtmux \033[34;1msessions active\n'
     fi
     printf '\033[34;1mAttach session?\033[0;m: [\033[35;1mname\033[0m] \033[37;2m(empty if none)\033[0m: '
-    read sesh
-    if [ -n "$sesh" ]; then
-        if tmux list-sessions | grep -q "$sesh"; then
-            tmux attach-session -t $sesh 
+    read session
+    if [ -n "$session" ]; then
+        if tmux list-sessions | grep -q "$session"; then
+            tmux attach-session -t $session 
         else
-            tmux new-session -s $sesh
+            tmux new-session -s $session
         fi
     fi
 fi