So I use the following to rename my tmux windows:
tmux rename-window (prefix + ,)
rename the current window
But when I do that command it keeps the old window name and I have to clear it to put in the new window name. Is there a way to have it cleared when I do prefix + ,
so I can just start typing the new window name?
You can remove the default value by adding something like this to your .tmux.conf:
unbind ,
bind-key , command-prompt -p (rename-window) "rename-window '%%'"
This will:
To emulate the existing behaviour, it would look like:
bind-key , command-prompt -I #W -p (rename-window) "rename-window '%%'"
...which tells command-prompt to use the current window name (#W
, an alias for #{window_name}
) as the initial, default value of the command prompt.