Hi, I tried your bindings and no, the cursor does not exit copy mode. I'm 
on a mac as well and both the tmux copy buffer and the macOS clipboard 
receive the text (through pbcopy). The cursor stays at its last position 
(when y was pressed) in copy-mode(-vi).

Do you get the reset behaviour for a completely empty .tmux.conf with only 
those two lines?

On Sunday, September 6, 2020 at 4:03:46 PM UTC-7 Peng Yu wrote:

> 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 <[email protected]> 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 
> [email protected]
> > 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 <[email protected]> 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
> > [email protected].
> > 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
>

-- 
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 [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/tmux-users/81e06491-bd40-4a3d-b5da-ca6545cc9cf2n%40googlegroups.com.

Reply via email to