Discovering tmux: It's Not Just About Windows

When I first heard about tmux, I dismissed it as just another window manager for the terminal. I already had tabs in my terminal emulator, so why would I need another layer of window management? The thing I didn’t realize: it lets your terminal session follow you across machines and network drops.

The Real Power: Session Management

Yes, tmux can split your terminal into panes and manage multiple windows. But the feature that actually changed my workflow was session management.

I move between my Mac Studio and MacBook frequently. With my remote VM development setup, this means I’m sshing into development VMs from different machines.

Before tmux, I’d regularly forget to terminate a long-running process when switching devices. I’d start a dev server on my desktop in my office, move to the couch with my laptop, then back to the desktop after lunch.

Usually the process stays running on my desktop but what if I need to view the output or restart it?

Creating Sessions

Starting a new tmux session is straightforward. I create a named session for each project:

tmux new -s session-name

Named sessions make it easy to keep track of what’s running. Instead of generic session IDs like “0” or “1”, I have descriptive names like “uplift-node” or “uplift-django”. When I list sessions with tmux ls, I immediately know which one I need to attach to.

Session Stealing

This is where tmux’s session management shines. When I ssh into my VM from my laptop, I can “steal” the tmux session that was attached on my desktop. The session detaches from one device and attaches to the other—instantly.

The command is simple:

tmux attach -d -t session-name

The -d flag detaches the session from any other clients before attaching it to your current one. No more orphaned processes. No more wondering what’s still running on the other machine.

Fewer Terminal Tabs

Another unexpected benefit: I need fewer terminal tabs open now.

Before tmux, I’d have 3-8 terminal tabs across various projects. One for the frontend, one for backend, one for git commands and other things. Rinse and repeat for multiple projects.

With tmux, I can have a single terminal for each project. No need for separate frontend, backend, and git terminals tabs.

Persistent Sessions

The underrated feature of tmux (at least if you think of it as a window management tool) is tmux’s persistence. Sessions survive network disconnections.

This means when my ssh connection drops—whether it’s switching networks, closing the lid on my laptop, or just flaky wifi–the session keeps running on the VM. When I reconnect, everything is exactly as I left it. No need to axe orphaned processes or restart development servers.

This was especially annoying on my MacBook. I’d work on a project, close the lid to move to a different room or take a break, and when I opened it back up, all my ssh connections would be dead.

With tmux, closing the laptop lid is a non-event. The ssh connection dies, sure, but the tmux session keeps running on the VM. When I ssh back in, I just reattach to the session and everything is exactly as I left it.

Final Thoughts

Tmux has become an essential part of my workflow. The session management alone justifies the learning curve. Being able to seamlessly switch between devices without losing terminal state is liberating, especially when combined with my remote VM setup.

If you’re doing remote development or frequently ssh into servers, give tmux a serious look. Don’t make the mistake I did and dismiss it as just a window manager. The session management is where the real value is (for me).