This lesson covers tmux fundamentals: what tmux is, how to start it, and how to work with sessions, windows, panes, copy/paste, and basic configuration. tmux (first released in 2007) is a modern terminal multiplexer similar to GNU Screen but with several enhancements:Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
- Client–server model: a single server manages multiple sessions; each session contains windows, and windows can be shared between clients.
- Interactive menus for selecting sessions, windows, and clients.
- The same window can be linked to multiple sessions.
- Supports both Vim and GNU Emacs key layouts.
- Full UTF-8 and 256-color terminal support.

- Start tmux from your shell:
- Session name
- Window index (tmux counts windows from 0)
- Window name (by default tmux shows the running program name and updates it automatically)
- An asterisk (*) indicates the currently visible window
- Host name, time, date, etc.
| Action | Keys / Command |
|---|---|
| New window | prefix + c (Ctrl+b then c) |
| Rename current window | prefix + , (Ctrl+b then ,), type name, Enter |
| List windows (chooser) | prefix + w (Ctrl+b then w) — navigate with arrows, Enter to select |
| Next window | prefix + n |
| Previous window | prefix + p |
| Jump to window N | prefix + N (e.g., prefix + 0) |
| Kill current window | prefix + & (confirmation asked) |
| Action | Keys |
|---|---|
| Split horizontally | prefix + ” (Ctrl+b then “) |
| Split vertically | prefix + % |
| Kill current pane | prefix + x (confirmation asked) |
| Move between panes | prefix + Arrow keys |
| Last active pane | prefix + ; |
| Resize by 1 line | prefix + Ctrl + Arrow |
| Resize by 5 lines | prefix + Alt + Arrow |
| Swap with previous pane | prefix + { |
| Swap with next pane | prefix + } |
| Toggle zoom for a pane | prefix + z |
| Show clock in pane | prefix + t (quit with q) |
| Convert pane to its own window | prefix + ! |
| Action | Command / Keys |
|---|---|
| List sessions (chooser) | prefix + s (inside tmux), OR from shell: tmux ls |
| Create a new session (shell) | tmux new -s NAME |
| Create session (inside tmux) | prefix + : then type new or new -s NAME |
| Rename session | prefix + $ |
| Attach to session | tmux attach -t NAME (short: tmux a) |
| Detach from session | prefix + d |
| Select which client to detach | prefix + D |
| Kill a session | tmux kill-session -t “SessionName” |
| Refresh client terminal | prefix + r |
Be careful: killing a pane, window, or session terminates processes running
inside it. Save work before confirming any kill operation.
- Enter copy/scrollback mode: prefix + [
- Navigate with arrow keys, PageUp/PageDown, or vi-style keys (if configured).
- Start selection with Space.
- Move to the end of selection.
- Copy selection with Enter (puts it into tmux buffer).
- Paste into the current pane with: prefix + ]
- System-wide config: /etc/tmux.conf
- Per-user config: ~/.tmux.conf
- Start tmux with an alternate config file: tmux -f /path/to/config
Tip: For the complete list of commands and detailed options, read the manual:
man tmux
- tmux manual: https://man.openbsd.org/tmux
- tmux GitHub: https://github.com/tmux/tmux
- Vim: https://www.vim.org/
- GNU Emacs: https://www.gnu.org/software/emacs/