tmux and dropped ssh connections

668 views
Skip to first unread message

Kee Hinckley

unread,
Jul 15, 2016, 11:57:30 AM7/15/16
to iterm2-discuss
I generally run tmux by ssh'ing to my remote machine, starting a tmux connection, and then working with one or more tabs. This works fantastically well. I've had times when I had a system crash, and when I come back up, iTerm automatically opens everything up exactly where I left off. It's amazing.

The one time things *don't* automatically get fixed is if my network connection drops and then comes back up. In that case I have to go to the original tmux terminal window, force disconnect, ssh in, and reattach.  Given that iTerm knows how to restart those connections from scratch after a crash, it would be nice if it could do it after a disconnect as well.

Marcus Bointon

unread,
Jul 15, 2016, 12:16:07 PM7/15/16
to iterm2-...@googlegroups.com
On 15 Jul 2016, at 17:57, Kee Hinckley <keehi...@gmail.com> wrote:

The one time things *don't* automatically get fixed is if my network connection drops and then comes back up. In that case I have to go to the original tmux terminal window, force disconnect, ssh in, and reattach.  Given that iTerm knows how to restart those connections from scratch after a crash, it would be nice if it could do it after a disconnect as well.

Take a look at mosh. It's awesome. My connections never die - I can put my computer to sleep, restart my ADSL router, switch networks, have a network outage and everything just stays up. It's fantastic for working with a tethered mobile on trains, where the network drops out all the time. That said, tmux and mosh still have some issues with relaying mouse events.

Marcus

Ralf Weber

unread,
Jul 17, 2016, 4:40:34 AM7/17/16
to iterm2-...@googlegroups.com
Moin!

On 15 Jul 2016, at 18:15, Marcus Bointon wrote:
> Take a look at mosh. It's awesome. My connections never die - I can
> put my computer to sleep, restart my ADSL router, switch networks,
> have a network outage and everything just stays up. It's fantastic for
> working with a tethered mobile on trains, where the network drops out
> all the time. That said, tmux and mosh still have some issues with
> relaying mouse events.
Mosh is awesome, but it also has a problem with the tmux and thus iTerm
scroll back buffer due to it's architecture. If you issue an command
that has more than one screen of output (and the output is fast) you
won't be able to see the start of the output that has scrolled off as
mosh will not have transferred it to the client machine.

I also use mosh and tmux together, but there are use cases where ssh and
tmux are better. And if you create your terminal windows with
Applescript you can easily create or reattach the tmux session with:
tell current session of myterm
write text "ssh HOST"
write text "tmux attach -t SESSION || tmux new-session -s SESSION"
end tell


So long
-Ralf

George Nachman

unread,
Jul 18, 2016, 6:12:32 PM7/18/16
to iterm2-...@googlegroups.com

On Fri, Jul 15, 2016 at 8:57 AM, Kee Hinckley <keehi...@gmail.com> wrote:
I generally run tmux by ssh'ing to my remote machine, starting a tmux connection, and then working with one or more tabs. This works fantastically well. I've had times when I had a system crash, and when I come back up, iTerm automatically opens everything up exactly where I left off. It's amazing.

The one time things *don't* automatically get fixed is if my network connection drops and then comes back up. In that case I have to go to the original tmux terminal window, force disconnect, ssh in, and reattach.  Given that iTerm knows how to restart those connections from scratch after a crash, it would be nice if it could do it after a disconnect as well.

--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages