I’ve been using GNU screen for several years now. I run it pretty much every time I open a new terminal window on my local machine, or SSH somewhere. I usually have several windows open, at the very least: bash, vim, ipython, jupyter and whatever else I happen to need at the time. The main benefit is: when you’re working remotely, and your SSH session is interrupted, screen will keep your programs running. You can simply reconnect to the remote machine, and resume the screen session. If you run long-running jobs remotely, it’s a huge plus. An added benefit is the ability to switch between windows quickly and efficiently: this applies for both local and remote work.

I’ve been hearing good things about tmux as an alternative to screen for about as long as I’ve been using screen. Finally, I caved and decided to give it a try. So far, I like it, in particular:

  • Setting up mouse interaction (scrolling, changing window sizes) on macOS is easy.
  • You can easily split windows both vertically and horizontally (OK, screen does this too, but it feels easier with tmux).
  • On top of the above, tmux does everything that I previously used screen for.

Getting used to the new keyboard shortcuts may take a bit more time, though. As a shortcut, I’ve remapped the prefix from C-b to C-a, which is the same as in screen. The other shortcuts I use frequently (and still fail to remember) are:

  • prefix + “: split window horizontally
  • prefix + %: split window vertically
  • prefix + ,: rename window

Some useful guides I keep going back to are here and here.

My humble start to a tmux dotfile is here. Stay tuned for more dotfiles!