Home » Posts tagged "Shell"

Using tmux – shortcuts

Even though Windows 7 is my main OS I use terminals a lot. I don’t mean the Windows command prompt in this case, though I actually use that a lot as well. The terminal I’m talking about now is Bash, which I use on my Raspberry Pi, VPS’s and virtual machines. To connect to these systems I use PuTTY.

The biggest benefit tmux gives is not having to open several terminals. Instead you use tabs (windows) or you split the current window. When I’m working on a project which has its own dedicated virtual machine (through Vagrant) I usually log in, create a 2×2 grid, setup 2 panes for tailing log files, another connects to MySQL and the 4th is available for regular terminal stuff.

Another nice feature is being able to detach your current session and return to it later. I do that with my Raspberry Pi for instance. Inside my tmux session I run irssi (an IRC client) and instead of having to reconnect all the time I just detach the session when I’m done, and recover it whenever I need to hop on IRC again.

Key in using tmux effectively is knowing the shortcuts. Memorizing them improves productivity a lot. So to help you get started I listed the main ones below.

  • ctrl+b % or ctrl+b " for pane splitting
  • ctrl+b space for changing pane orientation
  • ctrl+b n for next window
  • ctrl+b arrow keys for pane selection (older versions only support up/down)
  • ctrl+b , for renaming window
  • ctrl+b d for detaching session (close without shutting it down)
  • tmux a to resume a detached sessions

Am I missing any neat shortcuts? Let me know by dropping it in the comments.


One feature of Windows 7 I like is the new taskbar. At work I’ve configured it to only show the icons and this works surprisingly well. I can easily have multiple command line shells open. However, that is work. At home I’m using Windows Vista and the grouping feature in Windows XP and Vista at the toolbar is something I always turn off, as it annoys me to no end.

But when I’m working on some Perl related stuff I usually have multiple consoles open. One for my Catalyst test server, one for Gearman and another one for my Gearman worker. As mentioned earlier having multiple consoles open is a major pain in the ass on Windows Vista (or XP). So I’ve taken a quick look on the internet and found this lovely open source project called Console2.

Console2 is a simple but powerful tool. It allows me to have multiple consoles open with tabular navigation. Which results in only 1 window open. Yay!