My common workflow with tmux is using several per-project windows and navigating between them. Each “project” is usually a git-repo and I do all the things just inside this repo. Until recently I had to manually name each window to not fall into the mess of unnamed windows.

I have found that it’s possible to automatically set window’s name according to current directory: link. Even more, it is possible to use custom shell command to set it. So, to make your window named as your current pane git repository, you can use the following commands in your tmux.conf:

# sets window name to basename of git-root directory
set -g automatic-rename on
set -g automatic-rename-format '#(basename "$(git -C #{pane_current_path} rev-parse --show-toplevel 2>/dev/null || echo "#{pane_current_path}")")'

With most recent tmux version (tested with 3.3a on Linux and OSX) it should run okay without any weird issues.

Also take a look on the other notes: