Ramblings of an aging IT geek
← Ramblings of an aging IT geek
tooling

the day i stopped losing my work to a dropped ssh connection

A short note on why tmux became muscle memory after one too many long-running jobs died with a flaky connection.

A mechanical keyboard lit by a terminal

I lost a four-hour data migration to a dropped wifi connection once. The job was running in a plain SSH session, the laptop slept, the pipe died, and so did everything attached to it. I sat there looking at a broken connection knowing exactly what I'd done. That was the day tmux stopped being a thing I knew about and started being a thing I actually use.

The pitch is dull and the payoff is enormous: start your shell inside a session that lives on the server, not on your connection. The connection can die, your laptop can sleep, you can wander off for lunch, and the work carries on. You reattach and it's exactly where you left it, scrollback and all.

tmux new -s work     # start a named session
# ... connection drops, life happens ...
tmux attach -t work  # back exactly where you were

That's genuinely 90% of the value, right there. The window splitting and the status bar are nice, but the thing that earns it a place in my muscle memory is simply that long-running work no longer depends on my flat's wifi behaving itself.

I've added one habit on top: anything that'll run longer than a coffee gets started inside tmux on reflex now, before I even think about whether I need it. I don't, most days. The day I do, I don't have to remember. That's worth a screen prefix key I still occasionally fat-finger.