- Why use a terminal multiplexer?
- Keeps your hands on the keyboard
- Keep multiple terminals in eyeshot
- Detach/re-attach remote session (eg. for long-running processes)
- Like
screen
, but better
- In documentation,
C-b "
means holdcontrol
while pressingb
, then press"
(control does not need to be held when hitting the"
) M-x
means the same key-holding pattern, but using the meta key (also known asalt
)
brew install tmux --HEAD
~/.tmux.conf
holds your keybindings and global settings.
My current configuration
set -g prefix C-a # Personally, I like C-a as my prefix
bind C-a send-prefix
unbind C-b
setw -g mode-keys vi # allows for vi for scrolling through buffer + easy searching
set -g mouse on # mouse niceties
bind -n WheelUpPane copy-mode # go into copy mode when scrolling up
set -g history-limit 30000 # bump buffer length
set -s escape-time 50
set -g base-index 1 # start window numbering at 1 vs 0
setw -g pane-base-index 1
# Navigate panes using vi movements
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
Open
tmux # start a new tmux session
tmux a # attach to an existing session
tmux ls # list sessions
tmux new -s session_name # create new named session
tmux a -t session_name # attach to named session
In tmux - some common ops
C-a ? # help
C-a " # split window vertically
C-a % # split window horizontally
C-a x # close pane
C-a c # create new window
C-a : # enter command mode
C-a w # list windows
C-a <window_number> # switch to window #
C-a <space> # switch between windows layouts
C-a <arrow_keys> # move between panes
C-a d # detach from session
C-a [ # enter copy mode/navigate scrollback buffer
Tmuxinator (thx Jose!)
- Save your complicated tmux session configurations
- Useful for a per-project tmux session
thanks, this was useful!