Rename the session and a window
Session 0 is named project and its window 0 is named editor.
One key per level:
C-b $- rename the session
C-b ,- rename the current window
Both open a prompt with the old name already in it. Clear it with C-u first, then type the new name and press Enter.
Windows are renamed automatically after the program running in them, which is why a new window is sh and becomes top when you run top. Naming a window yourself — with -n or C-b , — switches that off for that window, and the name sticks.
Press C-b $, then C-u, type project, Enter.
The prompt opened showing 0; the status line now reads [project].
Press C-b ,, then C-u, type editor, Enter.
The prompt opened showing sh; the list now reads 0:editor*.
A name is only a label
A name is only a label. The window keeps its index and is still addressed by index, and two windows may even share a name.
Here is what just happened.
C-b $ runs rename-session on the attached session and C-b , runs rename-window on the current window, so neither needs a target. Renaming the window also turned automatic-rename off for it: it will keep editor whatever runs there next.
- Prompt for a new name for the attached sessionC-bthen$
- Prompt for a new name for the current windowC-bthen,
Go further
rename-window -t 1 logsrenames a window you are not on.set -wg automatic-rename offstops automatic renaming for every window.
- 1The prompt opens with the old name already in it. Clear it with
C-ubefore typing the new one. - 2
C-b $renames the session;C-b ,renames the current window. - 3
C-b $,C-u,project, Enter. ThenC-b ,,C-u,editor, Enter.
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- Session 0 has been renamed to project— not done yet
- Window 0 of session project has been renamed to editor— not done yet