Skip to content

Instantly share code, notes, and snippets.

@ideepika
Created June 17, 2021 07:16
Show Gist options
  • Select an option

  • Save ideepika/c66baed9b8ae314f38a02e7fdbdcd088 to your computer and use it in GitHub Desktop.

Select an option

Save ideepika/c66baed9b8ae314f38a02e7fdbdcd088 to your computer and use it in GitHub Desktop.
if [[ -z $TMUX ]]; then
builtin exit
return
fi
panes=$(tmux list-panes | wc -l)
wins=$(tmux list-windows | wc -l)
count=$(($panes + $wins - 1))
if [ $count -eq 1 ]; then
tmux detach
else
builtin exit
fi
}
^ in server which you are sshing in
the localhost using to ssh
tmosh() {
mosh --no-init $1 -- tmux new-session -ADs $2
}
should setup tmux+mosh client ssh instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment