> The top reason I did start using tmux was because of how you can select text with the keyboard in copy mode (like visual in vim mode). Then I got the plugin tmux-plugins/tmux-yank which adds "y" command to copy the text. Also works with selection by mouse.
Sure, but this is the internal "copy mode" of tmux, and is not useful to copy text in and out of your terminal.
You can configure tmux to synchronize with the X clipboard, although it is somewhat fiddly because of how terminal emulators work. See this page: https://github.com/tmux/tmux/wiki/Clipboard
In most terminal emulators you can also use Shift (or sometimes a different modifier) to bypass application mouse mode and have the terminal emulator handle the mouse event. Of course you can't copy out of the history with this, but that is another limitation of terminal emulators.
> that is another limitation of terminal emulators.
This seems more an excuse than a cause. When the "mouse mode" of tmux is off, the copy-paste mechanism works perfectly. There is no reason why this couldn't still be the case when the mouse mode is on. For example, tmux could enable the mouse only for scrolling and resizing the panes, while keeping the correct copy paste behavior intact. But it chooses not to.
No, this is not how it works. There is no terminal emulator that offers this kind of fine-grained mouse support. tmux can either turn the mouse on and handle everything (resize, scroll, copy and paste) itself, or it can leave it off and receive no mouse events.
tmux has no direct access to the X clipboard itself. Reading the clipboard with OSC 52 is possible but it is unfortunately not widely supported by terminal emulators (you can do it with `refresh-client -l` if the terminal emulator supports it).
Or you could read it with `xclip`, `xsel` or `pbpaste`, something like:
bind -n MouseDown2Pane run "pbpaste|tmux loadb -" \; pasteb
From tmux 3.2, middle click will paste the top tmux paste buffer by default.
No, it's not the internal "copy mode" of tmux, it's integrated with xclip (or xsel) so works via the normal clipboard I'm using in other applications too, it's basically the entire point of the tmux-yank plugin and why I shared it.
I could understand if you don't like tmux for other reasons (being a heavy mouse-user for example), that makes perfect sense. It's not for everyone. But if you take some time to understand why some things don't work like you expect it to (like what's the difference between a terminal emulator and tmux, what they have access to and so on) and how you could solve them, you'd avoid the issues you're describing.
But again, tmux is a tool aimed for keyboard users, not mouse. This tool doesn't fit everyone, and that's ok too. If you're willing to try it, you need to understand a few things before it'll work as you expect, otherwise your expectations will be wrong.
> I could understand if you don't like tmux for other reasons
I love tmux and I'm primarily a keyboard user. But sometimes I like to copy a short string from one window to another. Does tmux-yank allow you to middle-click paste on a tmux window? does it allow to select to copy?
Middle-click I don't know about, as I never use it. Usually I don't even have a mouse connected to my computer so I'm limited to a keyboard only. I use the provided `yank` (prefix+y by default) to copy and normal ctrl+shift+v to paste in terminal. Then in other applications I just use ctrl+v and ctrl+c normally.
It's simple for you to try it out as well, have a read about tmux plugins and you'll be up and running in a yiffy.
Also take some time to read up on terminal emulators, shells and what tmux is, as you seem to hold slightly off assumptions around where the problems you're experiencing are actually coming from. The reading and understanding will only make your personal knowledge base larger and deeper :)
To get pasting from the system clipboard, you need something like https://github.com/brennanfee/tmux-paste
It will copy whatever's on the system clipboard into tmux's paste buffer, and paste it, all with a single middle-click.
I've only recently started using tmux, and all this clipboard stuff was the biggest stumbling block. But I think I've got things work well enough now.
Sure, but this is the internal "copy mode" of tmux, and is not useful to copy text in and out of your terminal.