bin/tmux_default
2023-04-20 20:28:05 +02:00

15 line
286 B
Bash
Executable File

#!/bin/sh
#
for s in $(tmux list-sessions -F '#{session_name}'); do
p=$(tmux list-panes -F '#{pane_tty}' -t "$s")
if [ "$p" = "$(tty)" ]; then
# Session already running
exit 0
fi
done
tmux attach-session -t default_ssh || tmux new-session -s default_ssh