- Terminal multiplexer
- Multiple terminals
- Panes & windows
- Maintains connections
- Configurable
- Easy to use!
- Install tmux via package manager or download
- Make ssh "keep alive" for all connections by adding this to
~/.ssh/config
:
host *
ServerAliveInternal 300
ServerAliveCountMax 2
$ tmux
begins a new session$ tmux ls
lists available sessions$ tmux attach
attaches to a running session
Ctrl-b
is the prefix combination. Press the Ctrl key AND the letter b at
the same time. When inside a tmux session, the prefix is nearly
always pressed before the shortcut key to trigger a command.
For example, to display a list of tmux commands, type: Ctrl-b ?
That means press Control
and b
together, release, then press ?
You can change the prefix, see the config section.
Ctrl-b c
creates a new windowCtrl-b n
next windowCtrl-b p
prior windowCtrl-b w
list windows
Ctrl-b "
split pane horizontallyCtrl-b %
split pane verticallyCtrl-b o
next paneCtrl-b ;
prior paneCtrl-b direction
jump to paneCtrl-b Ctrl-o
swap panesCtrl-b space
arrange panesCtrl-b + direction
change pane sizeCtrl-b !
pop a pane into a new window
Ctrl-b [
enter scroll modeCtrl-b esc
exit scroll modeCtrl-space
begin highlight for copyAlt-w
copy highlighted textCtrl-b ]
paste text
~/.tmux.conf
is a plaintext file used by tmux for local config. If it doesn't exist, create it! This example config file shows some common options:
# set scroll history to 10,000 lines
set-option -g history-limit 10000
# modern encoding and colors
set -g utf8 on
set-window-option -g utf8 on
set -g default-terminal screen-256color
# unbind the prefix and bind it to Ctrl-a like screen
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# use zsh instead of bash
set -g default-command /bin/zsh
set -g default-shell /bin/zsh
To reload your .tmux.conf
within a tmux session, type: Ctrl-b :
then source-file ~/.tmux.conf
.
tmux has a lot of configuration options, here is advanced config example
- The official tmux website
- The tmux man page is extensive. Read it in the terminal by typing the command
man tmux
- This youtube series by Jay LaCroix is a good introduction
- This is another helpful introduction video for tmux
- The Arch Linux tmux documentation goes deeper, covers advanced features
- tmux - Productive Mouse-Free Development by Pragmatic Bookshelf is thorough introduction to tmux
Licensed under the FreeBSD (two clause) license.
© David Farrell 2015