Skip to content
shellhacks.dev
Tooling

Rename a window

Rename a tmux window with rename-window. A manual name turns off automatic-rename for that window, so it stops following the running command.

1 min read
Summarize in AI

A window is named after the program in it, and you want a name that says what it is for.

Shell
tmux new-session -d -s work -n shell
tmux rename-window -t work:shell build
tmux list-windows -t work -F '#{window_index}: #{window_name}'
tmux show-options -w -t work:build automatic-rename
Text
0: build
automatic-rename off

rename-window sets the name of a window, given by a target such as session:window, as the tmux manual describes. When you set the name by hand, tmux switches off automatic-rename for that window, the last line of output, and so the name stays through a change of program. The same effect follows from using -n at creation time.

The default for new windows is still automatic naming, so a name set once does not carry over to windows created later. Set automatic-rename off globally in ~/.tmux.conf if you want names to stick everywhere. Some shell prompts set the title with escape codes and overwrite the name unless allow-rename is off.

Share

More snippets

Tooling

Swap two panes in a window

Swap two panes in a window with swap-pane -s source -t target. The panes keep their IDs and running programs and trade positions, and prefix then braces do it.

2 min read
Tooling

Resize a pane

Resize a pane with resize-pane -x 30 for an exact width or -R 10 to move its edge. The keys are prefix then Ctrl and an arrow, one cell at a time.

1 min read
Tooling

Zoom a pane to full screen

Zoom one pane to fill the window with resize-pane -Z, or prefix then z, and call it again to restore. The window shows a Z flag while zoomed.

1 min read

Get new posts by email

One email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.