Files
dotfiles/tmux/tmux_attach.sh

14 lines
253 B
Bash
Raw Normal View History

2023-06-01 14:32:58 +02:00
#!/bin/zsh
#
# tmux-attach - attach to first unattached session or
# create new session if none are found
#
N=$(tmux ls | grep -v attached | head -1 | cut -d: -f1)
if [[ ! -z $N ]]
then
ATTACH_OPTS="attach -t $N"
fi
exec tmux $ATTACH_OPTS