I want to be able to select stuff in tmux and have it copy the selection into the copy buffer. When I left-click-drag, then release, I want what is selected to be in the copy buffer. I found this which seems to work:
bind -T copy-mode MouseDragEnd1Pane send -X copy-selection-no-clear
However, when I simply click in the window, it throws me into copy mode (even when I'm not). For example, on my desktop, let's say I was in another application, then I clicked inside the window to get back to ssh window with tmux. Annoyingly, tmux goes into copy mode. I now have to hit Enter to get it out of copy mode before I can type anything.
It's as if when I click in the window, tmux is interpretting this as a start and end drag event and the 'no-clear' is taking me into copy mode even though I'm not already in copy-mode. The bind seems to ignore the fact that I asked this only to be applicable in copy-mode. It's just a theory though.
Is there some way to fix this? Or is this perhaps a bug?