rc3.org

Strong opinions, weakly held

Tag: tools

Getting serious about terminal multiplexers

The biggest change in my work habits of 2012 has been the move from doing most of my work on my laptop to doing most of my work logged into a Linux virtual machine via SSH. I’ve used many editors over the years — Vim, Emacs, TextMate, UltraEdit, BBEdit, but the switch to working on the VM has led to using Vim for pretty much everything. For the past few months, I’ve been working hard to improve my Vim chops, with very pleasing results. I’ll probably write about Vim later.

The next thing I’m going to add to the toolchain is a terminal multiplexer. The two most popular are GNU Screen and tmux.

Terminal multiplexers have two main functions. The first is to enable you to run multiple virtual terminal sessions over a single SSH connection which you can arrange however you like and switch between using keyboard shortcuts. This is not incredibly useful to me because I use a terminal application with tabs and I’m very familiar with OS keyboard shortcuts, but using a multiplexer is more portable, and in some cases the ability to split a window and show multiple sessions adjacent to one another is really useful.

The second is that terminal sessions that are running from the multiplexer are maintained even if the network connection drops, accidentally or on purpose. I’ve used screen for awhile when I need to make sure that a long-running processes doesn’t die because I have to go to lunch or something. Using a multiplexer offers the ability to pick up your work exactly where you left off, all the way down to the scroll back buffer, even if your terminal session is disconnected or you work on more than one computer. My main motivation for picking up a multiplexer now is that my terminal sessions have started spontaneously dropping several times a day, and I’m eager to minimize the disruption.

The thing is, terminal multiplexers are beloved used by hardcore Unix users, so they probably have a large number of benefits I’m not even aware of yet, since I’m just really getting started. To this point all I really know is that you start screen by typing “screen” and that you reconnect to a disconnected session using “screen -r”. That feature alone, though, is compelling.

In the past I’ve only used screen, but I’m giving tmux a try. This blog post makes a convincing argument that tmux is more usable than screen. The place to start out, though, is the tmux man page.

I’m not sure what it says that development seems to be moving more and more back into terminal sessions, the way we did it twenty years ago. For all of the powerful desktop tools we used, these days I’m spending most of my day logged into a remote machine using a Unix shell and Vim. If you’re interested in digging into this more deeply, I highly recommend the Unix as IDE series from the Arabesque blog.

How I roll

Inspired by this post where Flickr’s developers talk about their toolset, here are the tools I use to get the job done:

  • 20″ iMac with second 20″ monitor (in the office)
  • 24″ iMac (home)
  • black MacBook (don’t leave home without it)
  • Terminal.app
  • Quicksilver
  • TextMate (for Rails and PHP development)
  • Eclipse (for Java development)
  • vim (for everything else)
  • Subversion
  • MySQL
  • Perl (I still rely on it for one offs)
  • Adium
  • Gmail (all my mail goes through my Gmail account)
  • MarsEdit
  • Google Reader
  • NetNewsWire

Update: I inadvertently removed Firefox (and Firebug) from the list when I was working on this post. I honestly don’t know how people do JavaScript without Firebug.

© 2024 rc3.org

Theme by Anders NorenUp ↑