I have the following lines in my ~/.tmux.conf. When I use mouse to
copy the text, the cursor will not be reset to the bottom. But when I
use y to copy the highlighted text, the cursor will be reset to the
bottom. Why they don't have the same behavior?
bind-key -T copy-mode-vi y send-keys -X copy-pipe pbcopy
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe pbcopy
In your test, you don't have the cursor reset to the bottom in either
cases? Thanks.
On 9/5/20, topcat <
anin...@gmail.com> wrote:
> For me using copy-pipe works for tmux 2.9a which is the oldest I have.
>
> On Thursday, September 3, 2020 at 10:18:43 AM UTC-7
stephane...@gmail.com
> wrote:
>
>> I just tried with your configuration, replacing both occurrences of
>> copy-pipe-and-cancel by copy-pipe and it works with the exact use case
>> that
>> you described (mouse selection). I'm using 3.2 though.
>>
>> Things you can check:
>>
>> - Make sure that you replaced the MouseDragEnd1Pane binding to
>> copy-pipe.
>> - Make sure that you reload the tmux configuration. If in doubt, exit
>> tmux and run `tmux kill-server`, then start a new session.
>>
>>
>> If that still does work, maybe try upgrading tmux to 3.2 but I doubt that
>>
>> this is the root cause.
>>
>> *Stéphane Gleizes*
>> [image: LinkedIn]
>> <
https://www.linkedin.com/in/stephane-gleizes-4924b899/>
>> On Sep 3 2020, at 5:49 pm, Peng Yu <
peng...@gmail.com> wrote:
>>
>> I used these lines. But they don't help.
>>
>> When I type ctrl-a [ then ctrl-b, then use my mouse to highlight a
>> text region, the cursor will still be reset to the very bottom.
>>
>> I use tmux 3.1b.
>>
>> Could you try my configure file to see what is wrong? Thanks.
>>
>> Strange, that's not expected behavior.
>>
>> I have the following binding and it works like a charm (tmux 3.2):
>> # Copy the current selection to a new buffer or start one if none is
>> active.
>> bind -T copy-mode 'Space' {
>> if -F '#{||:#{selection_active},#{search_present}}' {
>> send -X copy-pipe
>> } {
>> send -X begin-selection
>> }
>> }
>> If you are referring to mouse support, this is what I'm using:
>> # Avoid cancelling copy-mode if the pane history has been scrolled.
>> bind -T copy-mode 'MouseDragEnd1Pane' {
>> if -F "#{scroll_position}" {
>> send -X copy-pipe
>> } {
>> send -X copy-pipe-and-cancel
>> }
>> }
>>
>>
>> --
>> Regards,
>> Peng
>>
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "tmux-users" group.
> To unsubscribe from this topic, visit
>
https://groups.google.com/d/topic/tmux-users/0ffonwnQjEs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
>
tmux-users+...@googlegroups.com.
> To view this discussion on the web, visit
>
https://groups.google.com/d/msgid/tmux-users/5b0906cb-3cb8-4fd5-9d52-8d8e6275128an%40googlegroups.com.
>
--
Regards,
Peng