From a097de4a649a96fa34403ad0e4bbb009cdce1b47 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 6 Dec 2025 11:52:19 -0500 Subject: Adjust start-tmux script --- bin/.local/bin/start-tmux | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/.local/bin/start-tmux b/bin/.local/bin/start-tmux index 7ff8106..fa0e110 100755 --- a/bin/.local/bin/start-tmux +++ b/bin/.local/bin/start-tmux @@ -1,5 +1,12 @@ #!/bin/sh -set -e -tmux new-session -A -s "$USER" -d -exec tmux attach-session -t "$USER" || true +readonly SESSION_NAME="$USER" + +main() { + if ! tmux has-session -t "$SESSION_NAME" 2>/dev/null; then + tmux new-session -A -s "$SESSION_NAME" -d + fi + exec tmux attach-session -t "$SESSION_NAME" +} + +main -- cgit v1.2.3