A tmux Primer

Edit: It has been longer than 10 years now. Some links no longer work.

Originally posted April 1, 2014 on AIXchange

I wrote this piece about screen and vnc for IBM Systems Magazine 10 years ago, and I still refer to it, because I still use screen and vnc. However, I must admit that tmux is giving screen a run for its money these days.

A ton of good tmux tutorials are available, but I’ll start with this one:

“tmux is useful to people in different ways. To me, it’s most useful as a way to maintain persistent working states on remote servers—allowing you to detach and re-attach at will… you can use tmux to have multiple panes within multiple windows within multiple tabs within multiple sessions.”

Indeed, tmux does provide another way to look at detachable sessions. But why should a loyal screen user (like me) go learn something new?

“tmux is a lot like screen, only better. The short answer for how it’s better is that tmux is better designed to perform the same functions. Screen gets you there (kind of) but does so precariously.

“Here are a few of the key advantages of tmux over screen:

l    Screen is a largely dead project, and its code has significant issues

l    Tmux is an active project with an active codebase

l    Tmux is built to be truly client/server; screen emulates this behavior

l    Tmux supports both emacs and vim shortcuts

l    Tmux supports auto-renaming windows

l    Tmux is highly scriptable

l    Window splitting is more advanced in tmux

Enough about that. Use tmux.”

As I said, there are several other good tutorials on tmux. I also recommend this two-parter (here and here).

Perzl.org is the place to get tmux for AIX. Or start here if you’re unsure of how to get all the dependencies from perzl.org.

Once you master tmux, you won’t look back — and again, this is coming from a long-time screen user. Lately I’ve even been thinking that it would be nice if we could use tmux to reconnect to persistent sessions on the HMC.

Are you already using tmux? How about other persistent tools? I’m always looking for new things. Are there tools you’d recommend to me?