For people who use the terminal on a daily basis, multiple terminals really help. Over time we start to have a certain setup that we call home for multiple reasons: debugging, application development, configuring, etc… This is where tmux comes in. Sure there is also the program called “screen” but thats for another post.

Cool stuff

C-a : setw synchronize-pages on
C-a "

This will sync all of the pages on a window to allow you setting up multiple terminal sessions with the same commands. This is helpful when you want to have multiple terminals login to the same box (Perhaps for editing a config file and another terminal for stoping or starting services. Throw in another one for monitoring logs.)

Installation

At the time of this article, I had to have ruby 1.9.3 to install tmux by using the following command:

yum install tmux

To get help

If you are ever stuck and cannot remember a command, the following can help you out:

C-b ?

Press q to quit out of help. Will list all of the commands.

C-b :

Will allow you to type in a command and supports tab completion.

Simple stuff

Detaching

C-b d

Reattaching

tmux attach
tmux attach-session

Windows

C-b w Allows you to choose a window interactively.

C-b n Moves to the next window.

C-b p Moves to the previous window.

C-b x Kills the current pane with a prompt of yes or no.

C-b { Swap current pane with the previous one.

C-b } Swap current pane with the next one.

C-b w List windows

C-b ' Splits a window horizontally

C-b % Splits a window vertically

comments powered by Disqus