From 0eb9d449132f9bd478b52442c5a6a8ea97056a4b Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Sun, 25 Sep 2022 22:50:36 -0500 Subject: [PATCH] Quick add bug fixes --- zshmux.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zshmux.zsh b/zshmux.zsh index e87c974..3bb4634 100644 --- a/zshmux.zsh +++ b/zshmux.zsh @@ -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' -- 2.45.2