bin/tmux_default

15 lines
286 B
Plaintext
Raw Normal View History

2021-12-25 12:23:51 +01:00
#!/bin/sh
#
2022-10-10 14:05:48 +02:00
2022-10-10 14:18:04 +02:00
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
2022-10-10 13:48:07 +02:00
2022-10-10 14:18:04 +02:00
tmux attach-session -t default_ssh || tmux new-session -s default_ssh
2022-10-10 13:48:07 +02:00