One Thing Well

A weblog about simple, useful software.

tmux

tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.

That’s not all. You can split your tmux window horizontally and/or vertically, and panes can be moved, resized and repositioned easily. There’s even a set of predefined layouts borrowed from the world of tiling window managers. In fact, if you’re a real console devotee, you could use tmux in place of a window manager.

Scripting tmux is simple. Here’s what I run when I sit down in front of my Eee PC, to launch a terminal, mail client and news reader:

#!/bin/sh
tmux new-session -d -s main
tmux new-window -t main:1 alpine
tmux rename-window -t main:1 mail
tmux new-window -t main:2 'newsbeuter -r'
tmux rename-window -t main:2 news
tmux select-window -t main:0
tmux attach -t main

A tmux session

Add little touches like a well thought out default status bar or the easy-to-follow man page, and you have a serious rival to the venerable screen.