tmux terminal organizer

tmux is short for Terminal Multiplexer. And that’s what it does. It’s a neat little tool that I use to be able to have multiple sessions open at the same time and to be able to switch between them. As an example you can click on the picture to the right.

In this tmux session I have my Hercules console on the left, my running log file in the top-right and a support linux console in the bottom right. This session has one ‘window‘ and three ‘panes‘. I can ‘detach‘ from this session and exit from my machine. When I come back and login I just type:

tmux a

And I will be re-attached to my still running session again. Neat huh?

Install tmux

Installing tmux is as easy as:

sudo apt-get update
sudo apt-get install tmux

My tmux configuration

Some things in tmux are not to my liking, so I changed them. Should you like, you can put the following lines into your ~/.tmux.conf file:

-----------------------------------------------------------------
--- My tmux preferences
-----------------------------------------------------------------
#
--- first of all:
--- change prefix to Ctrl-a because that is easier to reach ---
--- and then of course unbind the deafule Ctrl-b key ---
set-option -g prefix C-a
unbind-key C-b
#
--- Also assign Ctrl-a to send the prefix to a remote session ---
bind-key C-a send-prefix
#
--- Force windows numbers to start from 1 ---
set -g base-index 1
#
--- Disable escape sequence delay ---
set-option -sg escape-time 0

More info

How to configure tmux on a cloud server. Read more about tmux in this online book. And here’s a ‘cheat sheet’ for tmux. (when you changed your prefix like I did above, do not forget to use Ctrl-a where it says Ctrl-b).