4 ms·
Yes, the mouse situation in tmux is catastrophic. As much as I love tmux, I wonder what would it take that the program respects the usual copy-paste convention
by enriquto 7y ago
Yes, the mouse situation in tmux is catastrophic.
As much as I love tmux, I wonder what would it take that the program respects the usual copy-paste conventions like all the rest of X programs. You need to do two things, that are apparently impossible when tmux has "mouse enabled":
1. select some text in your xterm so that it gets copied
2. middle click on the xterm and your copied text (possibly from other window, web browser, whatever) gets pasted at the cursor position
This is really simple and sane behavior but it's completely impossible to achieve with the current version of tmux. I have spend much more time that I am willing to admit seriously trying to do that.
- nmarriott 7y agoThis is little to do with tmux and much to do with the features offered to terminal applications by terminal emulators. Both clipboard and mouse support in terminals generally is quite limited. For the clipboard, this page documents how to configure it within the limits of what is possible: https://github.com/tmux/tmux/wiki/Clipboard https://github.com/tmux/tmux/wiki/Clipboard
- p1esk 7y agoThat's the main problem with tmux in my experience, whenever I open an issue or a feature request on tmux github, the devs say it's a terminal issue. I then open the same issue on the terminal github and the devs there say it's a tmux problem. Perhaps a solution could be combining a terminal and tmux into one product, so there would be no more excuses, however I don't think core devs are interested in getting a proper mouse support working in tmux.
- diggan 7y agoThe 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. I've run this setup now for something like 5 years across multiple tmux versions and OSes (Ubuntu and Arch) without any hiccups. But then I think tmux is a tool geared towards keyboard usage and not mouse. The mouse stuff was added because others wanted it, not because it was part of the core idea of what tmux wanted to provide. So if you go against that, you'll bang your head a little.
- enriquto 7y ago> 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.
- nmarriott 7y agoYou 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 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.
- enriquto 7y ago> 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.
- deleted 7y ago[deleted]
- nmarriott 7y agoNo, 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.
- tomphoolery 7y agoit works pretty well if you're in vi mode, because the same key commands are used in vim for visual mode. so you end up just getting used to scrolling that way.
- diffeomorphism 7y agoIt works just like that if you press shift?
- enriquto 7y ago> It works just like that if you press shift? My point exactly. I want to do that without pressing shift.
- tpei 7y agoThis also bothers me. As a keyboard guy it mostly bothered me that I could not jump to the thing that I wanted to copy. I found https://github.com/schasse/tmux-jump https://github.com/schasse/tmux-jump, which works really well with https://github.com/tmux-plugins/tmux-yank https://github.com/tmux-plugins/tmux-yank
- opan 7y agoWith my config a normal highlight interacts with tmux and if I hold shift it interacts with my terminal emulator. I'm using Termite, but I swear it worked the same in others like terminator and urxvt as well. I have both a local and remote tmux session and am basically exclusively using shells in tmux, so I've long since gotten used to in. This must be fairly standard, because a friend of mine uses Hexchat on Windows where a normal highlight can grab a line from IRC, but without the timestamp. Holding shift lets you grab all the actual text, timestamp included.