I've fought with tmux a long time with it's mouse selection and copy behavior. I like using mouse mode for the scrolling functionality but I've been plauged by issues where I want to paste something in, but when I click into the terminal window, it registers a "drag" event isntead of a click, causing a silent copy to occur, wiping my clipboard.
While the yank plugin fixes this, it also forces you to enter copy mode first, and I wanted to be able to select text from stdout or prior command without always entering copy mode. To use my config, you should NOT use yank.
This configuration (goes in tmux.conf.local, usually) does the following:
- Adds a conditional check to the mouse drag event (when in the default / root mode). It checks the mouse's position vs the "cursor" postition (the active prompt line in this scenario), and only enters copy-mode and starts the tmux selection if the mouse is ABOVE the prompt line. If the mouse is on or below the prompt line, it does nothing. Since you normally click on t