fix(tmux): pick the 1st session is a session had multiple match

This commit is contained in:
2026-03-14 10:36:25 -04:00
parent 0b0d064c0c
commit 0a8044247b
+2 -2
View File
@@ -19,7 +19,7 @@ if [ -z "$ZOXIDE_RESULT" ]; then
fi
FOLDER=$(echo $ZOXIDE_RESULT | awk 'BEGIN{FS="/"} { print $(NF-1)"_"$NF }' | tr '. ' '_')
SESSION=$(tmux list-sessions | grep $FOLDER | awk -F: '{print $1}')
SESSION=$(tmux list-sessions | grep -m 1 $FOLDER | awk -F: '{print $1}')
if [ -z "$TMUX" ]; then
if [ -z "$SESSION" ]; then
@@ -36,4 +36,4 @@ else
else
tmux switch-client -t $SESSION
fi
fi
fi