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

the ssh dropped and my work was still there

How tmux turned a dropped SSH connection from a small catastrophe into a non-event, and the handful of settings that made it stick.

A mechanical keyboard and terminal

For years my answer to a flaky connection was to not have one. I'd kick off a long job, hold my breath, and quietly resent the train wifi when the SSH session dropped halfway through and took my half-finished work with it. The fix had been sitting in front of me the whole time, and I'd been too lazy to learn it properly.

tmux keeps your shell session alive on the remote machine, detached from whatever terminal you happened to start it in. The connection dies, the session doesn't. You SSH back in, run tmux attach, and there's your work exactly where you left it, the long job still chugging away. The first time a connection dropped and I reattached to find nothing lost, I felt slightly foolish for having suffered without it.

The thing that made it stick was bothering to write a small ~/.tmux.conf rather than fighting the defaults. The two changes that earned their keep:

# C-a is easier to reach than the default C-b
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# don't make me squint at where my panes are
set -g mouse on

That's most of it. There's a whole world of status-line customisation and plugin managers I've deliberately stayed out of, because the point was never to build a cockpit. The point was to stop losing work to a dropped connection, and a near-empty config achieves that completely. Sometimes the win is just doing the obvious thing you'd been putting off.