My saga with tmux

I have been a longstanding user of GNU screen, a terminal multiplexor, which is loosely a terminal-oriented equivalent to an X window manager. For a fair number of years now, I have been using tmux instead; it was written more recently, starting from scratch, with BSD license, and so is somewhat smaller, perhaps faster, and leaves behind features that weren’t of much interest.

What I do with this

I commonly set up tmux sessions when I first log onto a system, and set up some sub-terminals tied to useful tasks such as:

  • Command sessions – I’ll always have some terminals ready to run commands
  • Log tails – if I am debugging something, I will set up a tail -f command in a virtual terminal to watch the logs, so that I may quickly switch to that terminal and see what has recently happened
  • ssh sessions for command sessions running on remote hosts (on my laptop, these will be mosh sessions
  • kubernetes sessions – command sessions where the CLI environment is set up for one k8s environment or another

Further tools

The awesome-tmux Github site has a whole lot of useful links to “meta-tools” for use with tmux, various of which I have found useful:

  • tmuxinator allows setting up a whole tmux session complete with numerous virtual terminals connected to commands and environments
  • gitmux puts git status information into the tmux status bar, which is nicer than putting it (as I have done with zsh) onto the start or end of the command line
  • tmux-continuum will automatically save the state of a tmux session environment so that a complex environment may be automatically recreated. This is pretty cool as a “perhaps better than tmuxinator” thing; with tmuxinator, it’s easy to restart, but you need to add environment configuration manually to tmuxinator configuration, whereas continuum picks that up automatically. There are definitely advantages and disadvantages in both directions; tmuxinator will tend to have a “cleaner” environment, but you need to do more work to get that cleanliness.

Also playing with 3mux

3mux was inspired by tmux and by the i3 window manager; it makes more natural use of the mouse, has a claimed-more-sane set of keybindings, and claims a shorter learning curve.

I have played with it a bit; in view that I had gotten through the GNU Screen learning curve many years ago, that’s not so much something I’d account as good, and the differences have proven demerits to me. Also note that there’s lots of third party projects improving on tmux that don’t naturally automatically apply to 3mux.

Other References

I did a talk in 2015 on Screen, Tmux, Byobu, the Secret Terminal Brains!!!

See also my web page on GNU screen, which has further links about tmux and related tools.