learntmux.dev

Show, set and unset options

Goal

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.

Do this

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.

Stuck on this one?

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

about 15 MB, once

session learn

Done when

not started
  1. The server option escape-time is 10— not done yet
  2. The global session option renumber-windows is on— not done yet
  3. Killing window 1 (scratch) left windows 0 and 1 with no gap— not done yet
  4. status-position is back to its default, bottom— not done yet