Windows let one session hold your editor, server, logs and shell side by side without extra terminal tabs.
A session contains one or more windows, each filling the whole screen, like tabs. The status bar at the bottom lists them as 0:bash* 1:logs-, where * marks the current window and - the previous one.
Default key bindings:
C-b ccreates a new window.C-b n/C-b pgo to the next / previous window,C-b 0...C-b 9jump by number,C-b ltoggles to the last used window.C-b ,renames the current window. Good names (editor,server,db) make the status bar useful.C-b wopens an interactive tree of all sessions and windows with previews; arrows and Enter pick one.C-b &kills the current window (after confirmation).
By default tmux renames windows automatically after the running program (vim, ssh); renaming one by hand switches that off for that window.
From the shell or the command prompt the same operations are commands: new-window -n logs, select-window -t 2, rename-window db, kill-window. Windows are numbered from 0; many people set base-index 1 so numbering matches the keyboard (see configuration).
Example
# inside tmux:
# C-b c new window
# C-b , rename it (e.g. 'server')
# C-b 0 jump to window 0
# C-b l back to the last window
# C-b w pick from a tree of sessions/windows
tmux new-window -n logs 'tail -f /var/log/syslog' # from a shell
tmux select-window -t logsRemember
- C-b c new, C-b n/p next/previous, C-b <number> jump
- C-b , renames; C-b w shows everything as a tree
- Status bar: * = current window, - = previous