Show, set and unset options
escape-time 10, renumber-windows on with the gap closed, status-position back to bottom.
Almost every part of tmux you have used — the prefix, the status line, the mouse — is an option. Three commands cover all of them:
show -g name- read it
set -g name value- write it
set -gu name- unset it, back to the shipped default
-u is worth the habit: it removes your override rather than setting a value, so you never need to know what the default was.
Options come in types — server, session, window, pane — but tmux knows which is which from the name, so in practice -g is all you type. What -g itself means matters: without it you change only the current session or window, not the global setting.
Press C-b :, type show -g status-position, Enter.
It says top, which is where the bar is now.
Press C-b :, type set -s escape-time 10, Enter.
No output — the server option is set.
Press C-b :, type set -g renumber-windows on, Enter.
Still nothing visible; the next close will show it.
Press C-b :, type kill-window -t :1, Enter.
The list goes from 0 1 2 to 0 1 — logs moved down to fill the gap.
Press C-b :, type set -gu status-position, Enter.
The bar jumps back to the bottom.
Where option values live
The types differ in scope. Server options apply to everything at once. Session and window options have a global set plus per-session or per-window overrides on top. Pane options work like window ones. Some options have no per-session override at all, which is when -g versus no -g stops mattering.
Here is what just happened.
escape-time is a server option, so -s marked it and it applies everywhere. renumber-windows made kill-window renumber what was left instead of leaving index 2 in place. -u removed your override rather than setting a value, so status-position fell back to the shipped default without you needing to know it.
- Show a global option; without a name lists all options of that type:show -g option
- Set a global session or window option (server options need no -g; -s marks them):set -g option value
- Unset a global option, restoring its default:set -gu option
Go further
show -s,show -gandshow -wgwith no name list every option of that type.escape-timeis how long tmux waits to tell Escape from the start of an arrow-key sequence; 10 ms suits local terminals.synchronize-panes onsends your typing to every pane in the window at once. Handle with care.base-index 1starts window numbering at 1.
- 1Everything is typed at
C-b :. You do not need-sor-wwhen you name the option; tmux knows its type. - 2
show -g namereads,set -g name valuewrites,set -gu nameunsets. - 3
set -s escape-time 10,set -g renumber-windows on,kill-window -t :1,set -gu status-position.
This is a live terminal. Typing goes to the machine, including Tab. Press Shift and Tab together to move focus back out to the page.
A real terminal, in this tab
Alpine Linux and tmux 3.4 on an x86 emulator. Nothing to install, and no server behind it.
about 15 MB, once
Done when
not started- The server option escape-time is 10— not done yet
- The global session option renumber-windows is on— not done yet
- Killing window 1 (scratch) left windows 0 and 1 with no gap— not done yet
- status-position is back to its default, bottom— not done yet