Has anyone managed to bind mouse buttons to custom functions in tmux?

According to the manual this should work:

bind-key -n MouseDown2Pane paste-buffer

This should let me take text that was previously copied with a click-and-drag, and paste with just a right click. However the line above causes an error on startup:

.tmux.conf:39: unknown key: MouseDown2Pane

This with tmux 2.0.0 compiled from source on an OpenSuse 12 machine, accessed from Windows over kitty.

I know there are other ways to copy and to paste; I am specifically trying be able to paste with a right mouse click only and no other keys or modifiers, with the tmux mouse mode enabled.

  • That feature is not in tmux 2.0. It should be in the next release, or you can build from source to try it now. – Chris Johnsen Jul 30 '15 at 5:27
  • Thanks! I was looking at openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1 and it wasn't clear that refers to git checkouts only. I'll wait until the actual release though because it looks like using the mouse wheel to scroll though the buffer isn't quite working yet. – user125467 Jul 30 '15 at 9:50
  • You also have another layer to think about and that is how your terminal emulator on Windows is processing your mouse. – vgoff Aug 2 '15 at 5:40

Your Answer

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

Browse other questions tagged or ask your own question.