From 2c7d137a1d7e58bca2150d3e70b492f8c54c4ffb Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 31 Mar 2020 23:06:26 +0200 Subject: [PATCH] differentiate between -s/-t for new sessions on older clients --- .bin/tmux | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.bin/tmux b/.bin/tmux index 38243a3..93837e0 100755 --- a/.bin/tmux +++ b/.bin/tmux @@ -13,7 +13,9 @@ real_tmux() { single_tmux_session() { local id; id="$1"; shift - real_tmux new -t "$id" "$@" + local flag; flag=t + real_tmux list-sessions | grep -q "^${id}:" || flag=s + real_tmux new -$flag "$id" "$@" } tmux_session_exists() { -- 2.39.5