aboutsummaryrefslogtreecommitdiffstats
path: root/bin/start-tmux
blob: 12b22ade5ab1cec201dc66d064a699c22258e6b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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