tmux script corrected

This commit is contained in:
Dirk Alders 2022-10-10 14:05:48 +02:00
parent 571bbdfcbe
commit bf1c7d7683

View File

@ -1,9 +1,13 @@
#!/bin/sh #!/bin/sh
# #
SESSION=$(tmux display-message -p '#S' 2> /dev/null) SESSION=$(tmux ls -F "#{session_name}")
echo $NEW
if [ "$SESSION" = "" ]; then if [ "$SESSION" = "" ]; then
tmux attach-session -t default_ssh || tmux new-session -s default_ssh tmux attach-session -t default_ssh || tmux new-session -s default_ssh
else
echo tmux-session \"$SESSION\" already running.
fi fi