Working with ‘tmux’

Working with ‚tmux‘ enables a number of terminals to be created, accessed, and controlled from a single screen in Unix. The screen can be splitted vertically and horizontally (called panes). Like ’screen‘ tmux can handle different sessions.

Get a list of running, named tmux sessions
~$: tmux ls

Create a new named tmux session
~$: tmux new-session -s [sessionname]

Reopen an existing tmux session
~$: tmux a -t [sessionname]

Shortcuts within a session:
Managing windows
Ctrl+b c: Open/Create a new window within a tmux session
Ctrl+b ,: Rename the current window
Ctrl+b n: Switch to next windows
Ctrl+b p: Switch to previous window
Ctrl+b w: List all windows
Ctrl+b 0-9: Switch to window 0-9 of the tmux session

Managing panes
Ctrl+b %: Split window vertically
Ctrl+b „: Split window horizontally
Ctrl+b arrow key: Switch pane
Hold Ctrl+b, don’t release it and hold one of the arrow keys: Resize pane
Ctrl+b [: Start copy mode. Simply quit with q. PgUp/PgDown lets you scroll up/down.
Ctrl+b q: Show pane numbers
Ctrl+b {: Move current pane left
Ctrl+b }: Move current pane right
Ctrl+b &ltspace>: Toggle through different pane layouts
Ctrl+b !: Break pane into its own window

Ctrl+b : setw synchronize-panes on/off: Synchronize commands to all panes

Managing Session
Ctrl+b $: Rename current session
Ctrl+b d: Detach current session
Ctrl+b &: Kill current session

Ctrl+b :: Open command prompt
Ctrl+b x: Exit terminal
Ctrl+b ?: Help

1: Detaching a session will leave it (and all its windows) but let it run in the background
2: Exit a pane/window will close it and it´s commands.

Download my .tmux.conf

External resources:
– http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/
– http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
– http://lukaszwrobel.pl/blog/tmux-tutorial-split-terminal-windows-easily/