ssh_to: start a tmux session if none is found
This commit is contained in:
parent
9661c41214
commit
aceb214659
@ -20,8 +20,8 @@ MOSH=`command -v mosh`
|
|||||||
HOST=${0##/*/}
|
HOST=${0##/*/}
|
||||||
|
|
||||||
if [[ ! -z $TMUX ]] ; then
|
if [[ ! -z $TMUX ]] ; then
|
||||||
echo "Error: tmux session detected, aborting to avoid tmux nesting"
|
echo "Error: local tmux session detected, aborting to avoid nesting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"${MOSH}" -- "${HOST}" tmux a
|
"${MOSH}" "${HOST}" -- sh -c "tmux a || tmux"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user