aboutsummaryrefslogtreecommitdiffstats
path: root/bin/start-tmux
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-10-17 10:40:11 -0700
committerEugene Triguba <hello@eugenetriguba.com>2026-10-17 10:40:11 -0700
commitea127689e0ae2d39b49004be605e541ff80e2621 (patch)
treeabbe79e5e37792bd8ebea8f9ac788ff5b8aed704 /bin/start-tmux
downloadopenbsd-dotfiles-ea127689e0ae2d39b49004be605e541ff80e2621.zip
Initial Commit
Diffstat (limited to 'bin/start-tmux')
-rwxr-xr-xbin/start-tmux13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/start-tmux b/bin/start-tmux
new file mode 100755
index 0000000..12b22ad
--- /dev/null
+++ b/bin/start-tmux
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -o errexit
+
+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