tmux-resurrect:
prefix + Ctrl-s
– save
prefix + Ctrl-r
– restore
Load tmux settngs:
prefix + I
– reload tmux environment
tmux yank:
prefix + [
– puts tmux in copy mode. You can now choose lines followed by y and they will be copied to clipboard
If yank does not work, install its dependency xclip like so:
sudo apt-get install -y xclip
then restart terminal and relaunch tmux. It will work now.
sudo apt-get install tmux
tmux
starts the tmux server
sudo apt-get install tmux
ctrl-b c
create window
ctrl-d
close window. This will close that pane as well.
^b &
close window with prompt
ctrl-b ,
rename window
ctrl-b n
next window
ctrl-b p
previous window
ctrl-b w
list windows
Panes : tiling manager
ctrl-b %
split vertically
ctrl-b :
put in command mode. split-window
split window horizontally
Ctrl-b "
split window horizontally
ctrl-d
close window. This will close that pane as well.
Panes: Resize
while pressing your bind key dont release your fingers and user the narrwors U D L R to resize your pan. BindKey + R to resize to the right side.
Sessions
tmux new -s newsession
hey tmux, create a new named session called newsession. This is just like before, but now this is a named session.
^b d
detach from the current session
tmux list-sessions
list all active sessions
tmux attach -t backupsession
hey tmux, attach to backupsession
# session management
tmux ls (or tmux list-sessions)
tmux new -s session-name
Ctrl-b d Detach from session
tmux attach -t [session name]
tmux kill-session -t session-name
Ctrl-b c Create new window
Ctrl-b d Detach current client
Ctrl-b l Move to previously selected window
Ctrl-b n Move to the next window
Ctrl-b p Move to the previous window
Ctrl-b & Kill the current window
Ctrl-b , Rename the current window
Ctrl-b q Show pane numbers (used to switch between panes)
Ctrl-b o Switch to the next pane
Ctrl-b ? List all keybindings
# moving between windows
Ctrl-b n (Move to the next window)
Ctrl-b p (Move to the previous window)
Ctrl-b l (Move to the previously selected window)
Ctrl-b w (List all windows / window numbers)
Ctrl-b window number (Move to the specified window number, the
default bindings are from 0 — 9)
# Tiling commands
Ctrl-b % (Split the window vertically)
CTRL-b ” (Split window horizontally)
Ctrl-b o (Goto next pane)
Ctrl-b q (Show pane numbers, when the numbers show up type the key to go to that pane)
Ctrl-b { (Move the current pane left)
Ctrl-b } (Move the current pane right)
# Make a pane its own window
Ctrl-b : “break-pane”
# add to ~/.tmux.conf
bind | split-window -h
bind – split-window -v