Read this:
https://github.com/tmux/tmux/wiki/FAQ#i-want-to-use-the-mouse-to-select-panes-but-the-terminal-to-copy-how

You may be able to make tmux itself copy to the clipboard, see
https://github.com/tmux/tmux/wiki/Clipboard. You will probably need to use
a terminal which supports OSC 52, such as mintty.


On Mon, 24 Jul 2023, 22:04 Akira KAKINOHANA, <kirameis...@gmail.com> wrote:

> Hello,
>
> I've been trying to use tmux multiple times, but haven't been able to
> switch from GNU screen. I've tried multiple different tricks to achieve
> what I want, but haven't been successful. I'm wondering if someone in this
> group could help me out..
>
> What I'd like to achieve is the following:
> 1. Use Cygwin terminal on Windows
> 2. SSH into a Linux (Ubuntu) node
> 3. Run (or attach to) tmux session in the remote Linux node
> 4. Within the tmux session, use the mouse-wheel to scroll up/down the the
> contents.
> 5. Also in the same tmux session, use the mouse to copy-paste
> functionality enabled by the Cygwin terminal. By "mouse to copy-paste", I
> mean..
> ** Simply select the text in the terminal to copy to the Windows clipboard
> (without pressing "shift" key)
> ** Click the mouse-wheel (3rd mouse-button) to paste the text in Windows
> clipboard onto the tmux session (again, without pressing "shift" key).
>
> For point 4. and 5. above, I could achieve *either* of those (but not
> both) with/without "mouse on".
>
> Environment:
> * tmux version (in remote Linux node): 3.0a
> * Cygwin terminal is configured s.t. "Middle mouse button"'s behavior is
> "Paste" (Under "Options > Mouse") and Mouse selection would be copied to
> clipboard (by checking "Copy on select" under "Options > Selection >
> Clipboard").
>
> What I tried so far in $HOME/.tmux.conf:
> 1. set (or set-option) -g mouse on ==> needed to press "shift" to achieve
> 5. above
> 2. (with mouse off) bind -n WheelUpPane if-shell -F -t =
> "#{mouse_any_flag}" "send keys -M" "if -Ft= '${pane_in_mode}' 'send-keys
> -M' 'copy-mode -e'" ==> WheelUp on my mouse would only lead me to the
> previous command I typed.
>
> I'm wondering what I'm missing.. or if it's even possible to let the point
> 4. and 5. above co-exist (again, without pressing "shift" key). Any
> help/input/suggestion will be appreciated!
>
> Best regards,
> Akira K.
>
> --
> You received this message because you are subscribed to the Google Groups
> "tmux-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tmux-users+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/tmux-users/30af6ed8-7ade-4f04-8e00-60de96b113d3n%40googlegroups.com
> <https://groups.google.com/d/msgid/tmux-users/30af6ed8-7ade-4f04-8e00-60de96b113d3n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tmux-users+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/tmux-users/CAEdLfcHN2YKHdw9swUg0Vwc9GJn8sFd_6KnGt_7e9ruhxvYhgg%40mail.gmail.com.

Reply via email to