Tmux

Tmux is since Core 87 available as an IPFire addon.

Tmux is a so called “terminal-multiplexer” and is similar to e.g. screen which allows the user to access multiple separate terminal sessions inside a single terminal window or remote terminal session. About the horizontal and vertical splitting of the terminal window in so-called “Panes“, different software can also be used, for example, on a real-time basis from which a quick, many-sided overview about processes can be attained.
Also sessions can be terminated (“detach”) but can later be executed (“attach”) again. Moreover, Tmux can be extended with configuration files (under e.g. ~/tmux.conf) for different purposes which do not exist by default yet.

Installation

Handling

Since tmux offers a lot of features, it would sprinkle the frame in here to list everything. For a deeper look into this subject several howtos can be found in the internet but may also some ideas in this wiki.

Tmux can be started without further options with a simple

tmux

Also options can be used to start tmux with special preferences like e.g.

Keycodes

The different processing modes can be activated about the so-called „bind-key” which is by Default [STRG] - or [CTRL]-b followed by the respective keycodes (key combination).

The keycode list is by far not complete and you are invited to extend it. It should give only an overview of some useful key combinations to use Tmux.

Section

Bind-Key

Keycode

Resultant sign

Action

Commands

INFOs

[CTRL]-b

[ ↑ ]-ß

?

List all keys

list-keys

[CTRL]-b

q

q

List pane number and pane size

display-panes

[CTRL]-b

[ ↑ ]-.

:

Edit commands in session mode

Session Managment

[CTRL]-b

s

s

List sessions

choose-tree

[CTRL]-b

[ ↑ ]-4

$

Rename current session

rename-session '%%'

[CTRL]-b

d

d

Detach from current session

detach-client

[CTRL]-b

r

r

Reload configuration file

source-file /root/.tmux.conf

Windows

[CTRL]-b

c

c

Create a new window

new-window

[CTRL]-b

,

,

Rename the current window

rename-window

[CTRL]-b

w

w

List all windows

choose-window

[CTRL]-b

x

x

Delete pane or window if one pane is left

kill-pane #P

[CTRL]-b

d

d

Dettach from the actual session

detach-client

[CTRL]-b

c

c

Add a new window

new-window

[CTRL]-b

0-9 or more

Changes to window with allocated number. 0 is the first window

select-window -t :{NR}

[CTRL]-b

[ ↑ ]-5

%

Split window horizontally

split-window -h

[CTRL]-b

[ ↑ ]-2

“

Split window vertically

split-window

[CTRL]-b

[ → ]

→

Change to pane on the right side

[CTRL]-b

[ ← ]

←

Change to pane on the left side

[CTRL]-b

[ ↑ ]

↑

Change to pane above

[CTRL]-b

[ ↓ ]

Change to pane below

[CTRL]-b [ESC]

[ → ]

→

Resize active window to the right

[CTRL]-b [ESC]

[ ← ]

←

Resize active window to the left

[CTRL]-b [ESC]

[ ↑ ]

↑

Resize active window higher

[CTRL]-b [ESC]

[ ↓ ]

↓

Resize active window lower

Example configuration

As mentioned before, Tmux can also be used with a configuration file which can contains a lot of different functions. As a little example, which should give an overview of what it could be possible, the following configuration file can be used.

The functions are explained a little so you can find may a little easier your own ideas for an individual configuration.
Tmux with this configuration file looks similarily like this one:

For further information of the Tmux configuration take a look at the bottom to the 'Additional informations' area.

Bash Script

There is also the possibility to arrange your own script which can makes jobs like e.g. attach to existing sessions, call your configuration file on every execution and to arrange your pane and window structure to your own needs. The following example should give an example of that.

You can place the script e.g. under /usr/bin, this script expects your configuration file under ~/.tmux.conf. If you name the script e.g. mux, you can execute it by simply type mux into the console or via ssh session. A requirement for this is that this script is executable

chmod +x {/path/scriptname}

The script arrange Tmux as in the following screenshoots shown.

Mux open up 3 windows in a session with different pane structure and content in it. The first window contains 3 different kinds of software iftop, bwm-ng and mtr. The second window quarters the window and waits for commands. The third window provides iptraf-ng. With the above configuration, the tabs in Tmux status bar but also the different panes are clickable with the mouse.

The terminal.app in OS X systems needs Simbl und MouseTerm for clicking and scrolling the Tmux window, pane and tabs.