This is an old revision of the document!
Tmux
General Information
Tmux is a terminal multiplexer. It is basically screen with more advanced features.
Checklist
- Distros: All
- Package: tmux
Install
Install tmux:
yum install tmux or apt-get install tmux
Tmux Operation
1) Open a terminal
2) Start a tmux session (default name)
tmux
Session Control
Start a named tmux session
tmux new -s MySession
Detach from open session
Ctrl+b d
List tmux sessions
tmux list-sessions
Attach to session
tmux attach -t MySession
Rename existing session
Ctrl+b :rename-session MyAwesomeName
Windows
Like screen, tmux has windows.
Create a new window
Ctrl+b c
Next Window
Ctrl+b n
Previous Window
Ctrl+b p
Rename Window
Ctrl+b , MyWindow
Panes
An advantage that tmux has over screen, is the ability to create panes.
Split window horizontally
Ctrl+b "
Split window vertically
Ctrl+b %
Kill current pane
Ctrl+b x
OR
exit
Navigate between panes
Ctrl+b up/down/left/right (arrow keys)
Maximize current pane (other pane moves to its own window)
Ctrl+b !
Auto-resize panes to equal space horizontally
Ctrl+b ESC+2
Auto-resize panes to equal space vertically
Ctrl+b ESC+1
Copy/Paste with Keyboard
Enter copy mode
Ctrl+b [
While in copy mode
Move around: arrow keys Start selection: space Copy selection: enter
Paste selection
Ctrl+b ]
Other Commands
Help
Ctrl+b ?
List Commands
Ctrl+b :list-commands
Tmux Config File
You can customize tmux with a config file in your home directory.
The following is a running list of customizations I find useful.
~/.tmux.conf
# use the vim motion keys to move between panes bind-key h select-pane -L bind-key j select-pane -D bind-key k select-pane -U bind-key l select-pane -R