brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: set -g automatic-rename off stops tmux renaming your windows

Tmux
~/tips/tip-tmux-automatic-rename-off

set-option -wg automatic-rename off

Stops tmux from renaming windows after the program running in them.

I name a tmux window once and expect it to stay that way. By default tmux renames windows after the running program, so my label can turn into zsh or vim a moment later.

With the window option automatic-rename on, tmux renames the window using the format in automatic-rename-format. The manual says it switches itself off for a single window when you name that window with new-window, new-session or rename-window, or when a terminal escape sequence sets the name. Windows you name yourself need no change.

For all windows, the manual gives this line:

set-option -wg automatic-rename off

After that, names only change when you change them, for example with Ctrl-b ,. A related option, allow-rename, controls whether programs in the pane may rename the window with an escape sequence:

set -wg allow-rename off

If you like automatic names but not the full command, change the format instead:

set -wg automatic-rename-format '#{b:pane_current_path}'

The b: prefix takes the basename of the value, so a window is named after the folder you are in.

With the rename off, a window keeps the name it got at creation, which is usually the shell. Name those windows yourself with rename-window if you want them to say something useful.

Further reading: tmux manual

Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more

More Tmux tips tmux new -d -s report -x 200 -y 50 'top' tmux wait-for build-done set -g allow-passthrough on tmux kill-server Ctrl-b [ All Tmux tips (125) All topics

Link