Actually mintty does not support this, so there is no way to get the
clipboard from Windows to tmux except by putting it in a file, copying it
to the remote host and then loading it. Or using a different terminal.


On Tue, 25 Jul 2023 at 11:47, Nicholas Marriott <nicholas.marri...@gmail.com>
wrote:

> You should be able to read the clipboard into a tmux paste buffer using
> "refresh-client -l".
>
>
> On Tue, 25 Jul 2023 at 11:17, Akira KAKINOHANA <kirameis...@gmail.com>
> wrote:
>
>> Hello,
>>
>> I've made some progress.Please consider this as an intermediate update.
>>
>> Summary:
>> * Copying the mouse-selected text in tmux session (in remote note via
>> ssh) to the local Windows clipboard by using MinTTY is achieved.
>> * Pasting the Windows clipboard text to the tmux session (with 3rd
>> mouse-button click) has NOT been achieved yet.
>>
>> What I did:
>> 1. Follow the instruction Nicolas gave in this thread:
>> https://github.com/tmux/tmux/wiki/Clipboard
>> 2. In my particular case, I also needed to enable the OSC 52 in my local
>> terminal (Cygwin-MinTTY running on local Windows). This was achieved by
>> adding following line in my *local* $HOME/.minttyrc (please note for
>> whoever reading this text in the future: this is one of the files that
>> MinTTY looks at, so may not be the optimal location for you):
>> AllowSetSelection=yes
>>
>> What is still missing:
>> * Above configuration allows me to copy the mouse-selected text to local
>> Windows clipboard. However, this does not yet allow to paste the clipboard
>> content to be pasted to the tmux session (unless you press "shift" key).
>>
>> I'll try to look for ways to paste the content into the tmux session.
>>
>> Best regards,
>> Akira K.
>>
>> On Tue, Jul 25, 2023 at 12:29 AM Akira KAKINOHANA <kirameis...@gmail.com>
>> wrote:
>>
>>> Thank you very much Nicolas for your inputs!
>>>
>>> I'll give it a try in next few weeks and get back to this thread with
>>> whatever findings.
>>>
>>> As for OSC 52, I seem to have been using mintty (or "mintty.exe", which
>>> is the shortcut target file from Cygwin terminal) all along, so I have have
>>> already been covered in that front..
>>>
>>> Best regards,
>>> Akira K.
>>>
>>> On Mon, Jul 24, 2023 at 11:37 PM Nicholas Marriott <
>>> nicholas.marri...@gmail.com> wrote:
>>>
>>>> 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>
>>>>> .
>>>>>
>>>>
>>>
>>> --
>>> Akira KAKINOHANA
>>>
>>
>>
>> --
>> Akira KAKINOHANA
>>
>

-- 
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/CAEdLfcH9gnVLG%2BM-Qa83J8kb9X-80kJ4X7odOpcE%2B4i3CJkbhQ%40mail.gmail.com.

Reply via email to