hanshq.net

tmux notes
(25 October 2014)

tmux is a terminal multiplexer, much like screen. I use it at work to keep my terminals organized. Typically I have one session running for each project, e.g. one for Chromium and one for LLVM. Within each session I often have one window for editing, one for compiling and running, and one for source control.

Key concepts: there can be multiple sessions running at the same time. Each session has a number of separate windows (usually numbered 0, 1, 2, ...), which can be split into panes.

Commands are prefixed with CTRL-b by default (as opposed to screen which uses CTRL-a).

d Detach
$ Rename current session
s List sessions
L Go to last session
, Rename the window
n Next window
w Previous window
l Last selected window
w List windows
? Show commands
" Split pane horizontally
% Split pane vertically
o Move to other pane
; Move to previous pane
CTRL-o Rotate panes
! Close the other panes
:new Create new session

In ~/.tmux.conf:

# Save more scrollback (default is 2000 lines).
set-option -g history-limit 100000

To attach to a specific session when starting: tmux attach -t session_name.

man page