From e41b15c5156acdfa8a99e29d67e2b25929f9c714 Mon Sep 17 00:00:00 2001 From: Stefan Reichoer Date: Fri, 28 Oct 2016 13:07:17 +0200 Subject: [PATCH] Work around a problem with tmux has-session: tmux has-session does a prefix match and not an exact match. When a session "ABC" does exist, the session "A" is also interpreted as "ABC" Using tmux list-sessions fixes this problem --- lib/layout-helpers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/layout-helpers.sh b/lib/layout-helpers.sh index b021d67..32b7737 100644 --- a/lib/layout-helpers.sh +++ b/lib/layout-helpers.sh @@ -253,7 +253,7 @@ initialize_session() { tmuxifier-tmux start-server # Check if the named session already exists. - if tmuxifier-tmux has-session -t "$session:" 2>/dev/null; then + if tmuxifier-tmux list-sessions | grep -q "^$session:"; then return 1 fi