Currently I'll often do prefix-cprefix-, to open a new window then rename it. I would like to make prefix-c automatically ask for a name for the new window.
Basically I want it to behave as if I'd entered prefix-:new-window -n
.How do I map prefix-c to that command?
I've tried adding bind-key c 'new-window -n'
to my ~/.tmux.conf but that doesn't work.
The Window name property is used for setting or returning the name of a window. It is generally used to modify the name of a window which has been created in the past. It returns a string which represents the name of the window. Return Value: It returns a string value that represents window name.
The name of the window is used primarily for setting targets for hyperlinks and forms. Browsing contexts do not need to have names.
You'll need a prompt to ask for the new window name:
bind-key c command-prompt -p "window name:" "new-window; rename-window '%%'"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With