Reputation: 87
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?
Upvotes: 7
Views: 837
Reputation: 809
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.
Upvotes: 8
Reputation: 1171
Easiest way, after rename prefix + ,
just press down button ↓
and start typing.
Tmux keep history of names, so you will able to get previously used names for window. For this just press up button again and again to find required name.
Upvotes: 5