diff --git a/dotfiles/tmux.conf b/dotfiles/tmux.conf index e69de29b..f83ac693 100644 --- a/dotfiles/tmux.conf +++ b/dotfiles/tmux.conf @@ -0,0 +1,5 @@ +# Automatically rename new sessions to the basename of the current directory +set-hook -g session-created 'run-shell "tmux rename-session -t #{session_name} $(basename #{pane_current_path})"' + +# Also rename when attaching to a session (optional) +set-hook -g client-session-changed 'run-shell "tmux rename-session -t #{session_name} $(basename #{pane_current_path})"' \ No newline at end of file