tmus script corrected
This commit is contained in:
parent
bf1c7d7683
commit
c24bd5ad9d
15
tmux_ssh
15
tmux_ssh
@ -1,13 +1,14 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
SESSION=$(tmux ls -F "#{session_name}")
|
||||
|
||||
echo $NEW
|
||||
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
|
||||
|
||||
if [ "$SESSION" = "" ]; then
|
||||
tmux attach-session -t default_ssh || tmux new-session -s default_ssh
|
||||
else
|
||||
echo tmux-session \"$SESSION\" already running.
|
||||
fi
|
||||
tmux attach-session -t default_ssh || tmux new-session -s default_ssh
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user