Tmux is great for remote/shared usage though (and it survives ssh disconnection).
Tmux is great for remote/shared usage though (and it survives ssh disconnection).
set -g option mouse on
to your `tmux.conf` and tmux will do mouse selections for you and won't cross pane boundaries.You can use something like tmux-yank² to get your tmux selections onto your OS/DE clipboard if you're not using a nice/modern terminal emulator with OSC 52 support and you don't want to manually plug in `xsel` or `pbcopy` or whatever. (See the tmux docs on clipboard integration³ if you're not sure whether/how your terminal supports the standard.)
--
1: https://www.man7.org/linux/man-pages/man1/tmux.1.html#MOUSE_...
The only remaining annoyance for me, and one which I don't think is "fixable"... say your left pane is a terminal and you've got a few pages of output (cat something). The right pane has a file open on vim, where you're making notes. As you scroll through the long output you want to select a chunk of text and then paste it into vim, and then carry on scrolling as you hunt for the next clue. Except that the instant you select text, focus returns to the prompt at the bottom of the pane. You compete lose your scroll position. It's intensely annoying. The workaround is "don't do it that way", which is fine until you forget and end up shouting at your computer.
If not, maybe you can you rebind the scroll wheel to enter copy-mode if it's not already in it, and then scroll, and bind enter/return while in copy-mode to exit copy-mode.
For anyone interested, this is in my .tmux.conf now
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send -X copy-pipe "xclip -selection c -i" \; send -X clear-selection
bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe "xclip -selection c -i" \; send -X clear-selection
You would have to switch the xclip for wl-copy if you're using Wayland, and some form of pbcopy command on Mac. No idea what windows folks do.