I'm trying to setup a tmux (1.9) key-binding to swap to windows. Unfortunately, I can't seem to figure out a way to send a variable for the swap. For example, if you hit C-b . It will then prompt where to move the window to. How can I get the same behavior with swap?

I have:

bind-key > swap-window -t {something else here...}

1 Answer 1


I figured it out. The best way to do it is to use the command-prompt feature.

bind > command-prompt -p "swap with" "swap-window -t '%%'"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .