53

screen has a Ctrl-a,Ctrl-a to switch between two latest windows?

How to do it in tmux?

77

To do this in tmux, you do

Ctrl-Bl

(that is an 'L'). This assumes you have left Ctrl-B as your activation key.

If you want to use the same keypresses as screen, then add the following to your ~/.tmux.conf:

set-option -g prefix C-a
bind-key C-a last-window

The first sets Ctrl-A as your activation key, the second says Ctrl-A after activation should go to the last window.

2

Paul's answer is correct, but it seems to leave you without a way to type ^A. Normally, if you had not bound the C-a to prefix, you simply use ^A. But you did... AND you mapped C-a C-a to be last-window, sooo....

However, all is not lost: C-a C-b now (oddly) gets you a ^A.

If you don't remap prefix, you can use C-b C-b to get ^B.

If for some reason you don't remap prefix and you map C-b C-b to last-window, I haven't figured a way to get a ^B out of it short of something like:

bind-key v send-prefix

... which will send a ^B if you type C-b v.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.