Tmux Cheat Sheet & Quick Reference | Session, window, pane and more
multi-pane terminal:
tmux is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal.
Ctrl + B + >: Open pane actions menu
Navigation:
Ctrl + B + %: Split the current pane with a vertical line to create a horizontal layoutCtrl + B + ": Split the current with a horizontal line to create a vertical layoutCtrl + B + ➡️: Switch to pane to the direction (works with ⬅️➡️⬇️⬆️)Ctrl + B + z: Zoom the current pane (make it maximized or minimized)
Sessions: tmux starts a session that lives in the background like screen does. So if ssh deteaches, the session lives on until reboot or until it's killed.
tmux new -s mysession: Allows naming a session -otherwise a random session name is generated.tmux ls: List sessions.tmux attach -t mysession: Reattach to session.tmux kill-session -t mysession: Clean up when done.Ctrl-B D: Manually detach from a running session.
Command Mode:
Ctrl + B + :: Enter command mode.
Commands:
:resize-pane -D|-U|-L|-R <number>:-D(down),-U(up),-L(left), or-R(right).<number>is the number of "cells" i.e. character grid rows/columns.- NOTE: To resize a pane in tmux, press
Ctrl+bfollowed byCtrland the arrow keys to adjust the size by one cell.
- NOTE: To resize a pane in tmux, press