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