Closed woutgg closed 8 years ago
Oooph, you're right. This is not great. Any ideas what the configuration change should be?
Looks like add select-pane -t=;
before copy-mode
will do the trick, credit @milosivanovic: https://github.com/tmux/tmux/issues/145#issuecomment-151123624.
I'm adding that now.
Yes, that fix seems to work great, thanks! However, the same change is required for the WheelDownPane event, so I think it looks like below. (This also fixes the scroll-on-first-event issue mentioned in the other thread.)
tmux bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' \"select-pane -t= \; $enter_copy_mode_cmd \; send-keys -M\""
tmux bind-key -n WheelDownPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' \"select-pane -t= \; send-keys -M\""
Thanks, good point; I realized that too after adding just the first line.
I was actually able to get this to work with the much simpler tmux bind-key -n WheelDownPane send-keys -M -t =
.
I added these two lines in fd78e441c. This should now be fixed.
Ah, never mind. I was missing a detail: the way I had it, it didn't select the pane, just scrolled in it. I've changed it now to your suggestion. Thanks @woutgg.
Fixed in 19e602f795f08.
Also, I've added c28119ac90045 which adds an option @scroll-without-changing-pane, off by default, to allow scrolling without selecting the pane.
This is not how tmux 2.0
worked, but I prefer it working this way. :) Thanks again @woutgg.
Great @NHDaly! Thanks so much for your effort! I had not even noticed the pane selection issue yet.
Two remarks:
scroll-in-moused-over-pane
disabled, wheel-scrolling from a non-selected pane causes almost no actual scrolling in the active pane. It may be a glitch, it might be my setup...can you confirm/deny this?send_keys_to_tmux_cmd
variable is never used? Did you mean to use it in the wheeldown event command?:) no problem. Thanks for the thorough followups!
send-keys -M
does nothing if it's not over the current window, but copy-mode
doesn't care where your mouse is. :/ It might be that I just shouldn't expose this option at all, because turning it off sucks.
Maybe there is some clever way to say "if the mouse isn't over the current shell, do nothing"? Or, what I think would be ideal, is with this option disabled just send all the scroll events to the selected window, no matter where the mouse is. But I'm not sure how to do that either.-t=
in the if-shell
s is sufficient. I have deleted send_keys_to_tmux_cmd
in b4eff146a2a.Could this a bug in send-keys
then?
I've noticed a second, similar effect. To reproduce:
scroll-in-moused-over-pane
enabledIt does not seem to matter which one is the selected pane, and adding -t=
to send-keys
does not change anything as you already mentioned. I'm at a loss here.
Hmm, I do not notice that effect at all. :(
BUT, that said, you did cause me to find another bug, which is that as I had it, selecting the moused-over pane only happened when entering copy-mode but not when scrolling once you were already in copy-mode.
To fix that i've added a select-pane -t=
to before the send-keys -M
for the #{pane_in_mode}
case: Fixed in 893e1b1ddde5d34280d3a30be7438b07d3da4d5b.
Maybe it was due to your last fix, the glitch I described seems to be gone. I'm happily scrolling away now. :) Thanks again for your work!
:D Glad to hear it! Thank you for being so persistent and going through this with me!
Me too!!! <_scroll scroll scroll_>
On Mon, Nov 16, 2015 at 4:27 AM, Wouter R. notifications@github.com wrote:
Maybe it was due to your last fix, the glitch I described seems to be gone. I'm happily scrolling away now. :) Thanks again for your work!
— Reply to this email directly or view it on GitHub https://github.com/NHDaly/tmux-scroll-copy-mode/issues/3#issuecomment-157012741 .
:D
Before the mouse overhaul, automatic enter/exit of copy mode also worked on other panes than the active one, i.e., the one over which the mouse cursor is located instead. It would be nice to have this behaviour again since this allows for easier and quicker use of scrollback buffers.