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: Ctrl-b , renames the tmux window you are in

Tmux
~/tips/tip-tmux-rename-window

Ctrl-b ,

Gives the current tmux window a name you choose, so the status bar tells you what is running where.

Every new window is called after the program in it, and four windows that all say bash tell you nothing. Give them real names.

Ctrl-b ,

The status bar line turns into a prompt with the old name filled in. Delete it, type something like logs or editor and press Enter. The new name shows in the status bar at once.

tmux keeps renaming a window after its program while automatic renaming is on. Once you rename a window by hand, tmux stops doing that for this window. If you want the automatic names back, run tmux set-window-option automatic-rename on.

The same thing works from the command line: tmux rename-window -t 2 logs renames window 2 of the current session. That helps in a script that builds a layout and wants every window named from the start.

Try it safely: start a throwaway session with tmux new -s scratch, run it there, and close the session again with tmux kill-session -t scratch. Nothing else is touched.

Further reading: tmux manual page (OpenBSD, official), tmux wiki: Getting Started (official)

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