Brett Y
Brett Y

Reputation: 7678

Create new window and set name

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.

Upvotes: 14

Views: 12485

Answers (1)

jasonwryan
jasonwryan

Reputation: 4556

You'll need a prompt to ask for the new window name:

bind-key c command-prompt -p "window name:" "new-window; rename-window '%%'"

Upvotes: 18

Related Questions