From: Huck Boles Date: Mon, 26 Sep 2022 03:50:36 +0000 (-0500) Subject: Quick add bug fixes X-Git-Tag: v1.0 X-Git-Url: https://git.huck.website/?a=commitdiff_plain;h=0eb9d449132f9bd478b52442c5a6a8ea97056a4b;p=zshmux.git Quick add bug fixes --- 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'