cfg/bin/resume
Knut Ahlers a9570cde04
Make errors more verbose
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2017-09-19 11:17:41 +02:00

19 lines
355 B
Bash
Executable File

#!/bin/bash
function fail {
echo "Error: $@"
exit 1
}
[ -n "${TMUX}" ] && fail "You are already in tmux!"
( which tmux 2>/dev/null ) || fail "No tmux found, can't continue"
tmux-agent
if ! ( tmux list-sessions ); then
tmux new-session -d
tmux split-window -h
fi
tmux attach-session -t $(tmux list-sessions | sort -n | head -n1 | cut -d: -f1)