How could I bind to last (most recent) session? The obvious last-session leads to an "unknown command" error.

bind-key z last-session

Don't know about how to bind to the Eject key (it's too far from the home keys anyway!) but this will do the trick:

bind-key -n z switch-client -l
  • Doesn't this bind z to this action even without the tmux prefix? I'd prefer bind-key z switch-client -l so it's easier to type z into a terminal when it's needed. – davidvandebunte Nov 21 '18 at 22:18

In recent versions of tmux (e.g. 2.6) the key Prefix-L is already bound to the command switch-client -l which as user47464 pointed out is probably what you want.

You can check your bindings with Prefix-?:

bind-key    -T prefix       L                 switch-client -l

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.