Discussion:
Patch to add "exit copy mode when scrolling past bottom" + option
David Verhasselt
2015-05-02 12:44:12 UTC
Permalink
A couple of weeks ago the mouse-related code was refactored and a feature
was removed: This feature exited copy-mode when scrolling with the mouse
down past the bottom. Combined with the feature that entered copy-mode when
scrolling up with the mouse, this was useful to emulate intuitively
expected behaviour of scrolling in the terminal.

I liked that feature but also wanted to use the new refactored mouse code
(much better!), so I re-added it. I also added an option
"exit-copy-past-bottom" to enable or disable it. Because of the refactoring
the mouse event is now translated into a normal command "scroll-up", and
thus it's impossible (I think?) to make this work only when the mouse is
used to scroll. This means that when it's enabled, scrolling down when at
[0/x] with the keyboard will also exit copy mode.

This is my first patch for a C open source project and the core
contributors could probably do a much better job, if they wanted to re-add
this feature, but maybe for now it's useful to other people who would also
like this functionality.

Enable the option:

setw exit-copy-past-bottom on

By the way: to start copy-mode when scrolling you can just use this, no
patch necessary:

bind -n WheelUpPane copy-mode

Cheers,
David
Thomas Adam
2015-05-02 23:28:12 UTC
Permalink
Post by David Verhasselt
A couple of weeks ago the mouse-related code was refactored and a feature
was removed: This feature exited copy-mode when scrolling with the mouse
down past the bottom. Combined with the feature that entered copy-mode when
scrolling up with the mouse, this was useful to emulate intuitively expected
behaviour of scrolling in the terminal.
I haven't tested this, but I don't think this patch is needed, given
something like:

bind -n WheelDownPane if -Ft=
"#{?pane_in_mode,#{?scroll_region_lower},,},," "send c-m"

-- Thomas Adam
Enrico Ghirardi
2015-05-03 14:26:18 UTC
Permalink
Post by Thomas Adam
I haven't tested this, but I don't think this patch is needed, given
bind -n WheelDownPane if -Ft=
"#{?pane_in_mode,#{?scroll_region_lower},,},," "send c-m"
I'm not sure if it's only me, but #{scroll_region_lower} always
returns the same value
(session height - 1) making that snippet useless. Also from the
documentation for
me it isn't really clear what #{scroll_region_*} should expand to and represent.

--
Enrico Ghirardi
Nicholas Marriott
2015-05-03 17:53:28 UTC
Permalink
scroll_region_* are for something else (the scroll region). This would
need a new format. Which would be a reasonable solution.
Post by Enrico Ghirardi
Post by Thomas Adam
I haven't tested this, but I don't think this patch is needed, given
bind -n WheelDownPane if -Ft=
"#{?pane_in_mode,#{?scroll_region_lower},,},," "send c-m"
I'm not sure if it's only me, but #{scroll_region_lower} always
returns the same value
(session height - 1) making that snippet useless. Also from the
documentation for
me it isn't really clear what #{scroll_region_*} should expand to and represent.
--
Enrico Ghirardi
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
tmux-users mailing list
https://lists.sourceforge.net/lists/listinfo/tmux-users
Loading...