Script to auto-reconnect SSH connections to tmux sessions
Mon, May 12, 2025 in /coder/Blog Series: "Rapid Backend Prototyping on a Remote Server"
I like the idea of SSH’ing into a tmux session when doing work on a remote machine so that I can reconnect right where I left off.
However, I don’t like it when the internet connection is unstable, and you must reconnect whenever you drop off. Or, when I close my laptop for a couple of hours and open it back up to a crashed terminal emulator. I tried using mosh
as I’ve done with IRC before, but I didn’t like how the terminal scrolling & copy/paste behaviour was affected unintuitively by mosh & tmux.