Expose mouse reporting state to extensions

Rastislav Barlik barlik-arch at gmx.com
Wed Jun 21 20:46:25 CEST 2017


I've been trying to get mouse scrolling working for applications using
alternate screen (less, man, ...). On alternate screen, urxvt only
allows to scroll in the history buffer.

This behavior is different from VTE based terminals, which for
alternate screen simulate key-presses instead of scrolling the history
buffer. I like this behavior and I would like to replicate it inside

I've found a plugin called 'vtwheel' [1] which is supposed to replicate
the behaviour. It works for 'man' or 'less', but it changes the
behavior of scrolling inside 'vim'. For vim, it scrolls the screen but
it also changes the cursor position, which I don't like.

Looking at the source code of VTE, I've found out that key-press
simulation for alternate screen is disabled when the mouse reporting is
turned on. So for other programs like 'man' or 'less', that
don't use mouse-reporting, scrolling is done using simulated key
presses. Conversely, vim uses mouse reporting, so scrolling is
therefore unchanged and handled by vim itself.

So in order to have the same behavior in urxvt, the simplest option
would be to change vtwheel to check for mouse reporting and not to do
key-press simulation when it's turned on, but as far as I know, mouse
reporting is not exposed to the perl extensions.

Therefore, I'm sending this patch to expose the state of mouse-reporting
to the perl extensions.

[1] https://aur.archlinux.org/cgit/aur.git/plain/vtwheel?h=urxvt-vtwheel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mouse-report-status01.patch
Type: text/x-patch
Size: 536 bytes
Desc: not available
URL: <http://lists.schmorp.de/pipermail/rxvt-unicode/attachments/20170621/e371b47e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mouse-report-status02.patch
Type: text/x-patch
Size: 428 bytes
Desc: not available
URL: <http://lists.schmorp.de/pipermail/rxvt-unicode/attachments/20170621/e371b47e/attachment-0001.bin>

More information about the rxvt-unicode mailing list