aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2025-12-06 11:52:19 -0500
committerEugene Triguba <hello@eugenetriguba.com>2025-12-06 11:52:19 -0500
commita097de4a649a96fa34403ad0e4bbb009cdce1b47 (patch)
treefb41ceedfd130afccfbbe714ae2a652f4e9134e7
parentAdjust vim config (diff)
downloaddotfiles-a097de4a649a96fa34403ad0e4bbb009cdce1b47.zip
Adjust start-tmux script
-rwxr-xr-xbin/.local/bin/start-tmux13
1 files 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