User Tools

Site Tools


tmux

tmux

Invocation options

control mode (can be used with iTerm2)tmux -CC
create new session with a nametmux new-session -s $SESSIONNAME -d
create new session, but leave unattachedtmux new-session -d
list sessionstmux ls
kill a particular sessiontmux kill-session -t $SESSIONNAME

Keyboard Shortcuts

The “tmux” combo as listed here represents Ctrl+B by default.

Window management

New window tmux + c
Rename window tmux + ,
Close window tmux + &
Previous window tmux + p
Next window tmux + n
Select window by number tmux + [0-9]
Move window tmux + . [0-9]
Rename window tmux + ,

Pane management

Vertical splittmux + %
Horizontal splittmux + “
Move pane to lefttmux + {
Move pane to righttmux + }
Switch between layoutstmux + Space
Move to panetmux + [Arrow keys]
Convert pane to windowtmux + !
Close panetmux + x

Session management

Show all sessionstmux + s

Copy mode

Within copy mode, controls behave like vi.

Enter copy modetmux + [
Quit copy modeq
Start selectionSpace
Copy selectionEnter
Paste buffer contentstmux + ]
Clear selectionEsc
Save buffer to file:save-buffer output.txt

Internal commands

Send commands to all panes:setw synchronize-panes
Set option for all sessions:set -g OPTION
Set option for all windows:setw -g OPTION
Show list of keyboard shortcutstmux + ?

Sample .tmux.conf

# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-a
bind-key C-a last-window
 
# Reload key
bind r source-file ~/.tmux.conf
 
# Terminal Settings
set -g default-terminal "screen-256color"
set -g history-limit 10240
 
# Mouse support
set-option -g mouse on
set-encoding=utf8
 
# THEME
set -g status-bg brightblack
set -g status-fg brightwhite
set -g status-interval 60
set -g status-left-length 30
set -g status-left '#[fg=white](#S) #[fg=red]#H#[default]'
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=blue]%H:%M#[default]'
tmux.txt · Last modified: by wolfo

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki