To rename a tmux session, press Ctrl+b followed by $. You can also use the command tmux rename-session -t old-name new-name from outside tmux.
Giving your tmux sessions meaningful names helps distinguish between different projects or tasks. You can rename a session either from within tmux or from the command line.
Ctrl+b (the prefix key)$ (dollar sign)Enter to confirmCtrl+b (the prefix key): (colon) to open the command promptrename-session new-nameEnter to confirmtmux rename-session -t current-name new-nametmux rename -t current-name new-name (shorthand)tmux rename-session -t 0 new-name (rename by session number) When creating a new session, you can specify the name directly: tmux new-session -s session-name or tmux new -s session-name for short.
The session name appears in your tmux status bar by default. You can customize how session names appear in your status bar by modifying the status-left option in your ~/.tmux.conf file.