Created attachment 679542 [details, diff] patch that adds sgr 1006 mouse mode support to urxvt Hi! This patch adds sgr 1006 mouse mode support to urxvt. This seems to be the only way to get the mouse to work past column 223 when running urxvt + screen/tmux + vim. Vim supports both ttymouse=urxvt (1015) and ttymouse=sgr, but screen and tmux support only the more widely available sgr mode. https://savannah.gnu.org/bugs/?37206 I found it over at Arch's AUR and adapted it to apply cleanly on 9.22. https://aur.archlinux.org/cgit/aur.git/tree/sgr-mouse-mode.patch?h=rxvt-unicode-cvs-patched-wideglyphs
Created attachment 679545 [details] ebuilt that applies the patch
Could you extend this patch so that this feature can be either enabled or disabled at build time, please? It is generally frowned upon in Gentoo to have patches applied conditionally, and I will definitely not enable a third-party feature for everyone.
Hi Marek, Thanks for your quick reply! Fair enough, that makes a lot of sense. I'm mainly a Python developer, so this autoconf stuff is a bit new to me, but I took a stab at it. Apologies if I made some obvious mistake. I re-wrote parts of the code as preprocessor conditionals with a new macro ENABLE_SGRMOUSE with its own autoconf flag --enable-sgrmouse. Then I added "sgrmouse" as a use flag in the ebuild and in the package metadata.xml. Does that sound like an acceptable solution? I'll attach the new files below. I tested building with/without sgrmouse and then tested all mouse modes with vttest (https://invisible-island.net/vttest/) and in vim. Everything works as expected: SGR only works with sgrmouse and all the other modes work in both cases. (To make vim enable ttymouse=sgr on urxvt you need to fool it with e.g. TERM=screen.) It also correctly reports whether it was built with sgrmouse support now: $ urxvt -help rxvt-unicode (urxvt) v9.22 - released: 2016-01-23 options: perl,xft,styles,combining,blink,iso14755,encodings=eu+vn+jp+jp-ext+kr+zh+zh-ext,fade,transparent,tint,XIM,frills,sgrmouse,selectionscrolling,wheel,slipwheel,cursorBlink,pointerBlank,scrollbars=plain+rxvt+NeXT+xterm [...] Best regards, Oscar
Created attachment 680104 [details, diff] Take 2: patch for sgrmouse flag
Created attachment 680107 [details] Take 2: ebuild with sgrmouse flag
Created attachment 680113 [details] Take 2: metadata.xml for sgrmouse use flag
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01fa0495e04575b2295bfb0afe2164caba7511e4 commit 01fa0495e04575b2295bfb0afe2164caba7511e4 Author: Marek Szuba <marecki@gentoo.org> AuthorDate: 2020-12-31 14:45:19 +0000 Commit: Marek Szuba <marecki@gentoo.org> CommitDate: 2020-12-31 14:52:49 +0000 x11-terms/rxvt-unicode: Optionally support xterm SGR 1006 mouse extension Needed in order for mouse tracking to work properly in large terminals, for all applications which do not the urxvt 1015 extension (and not many do). Relies on a third-party patch (ported from AUR, and extended to make this feature dependent on a build-time flag, by the bug reporter), as upstream allegedly refused to implement this. Suggested-by: Oscar L <oscar_bugs@nym.hush.com> Closes: https://bugs.gentoo.org/761787 Signed-off-by: Marek Szuba <marecki@gentoo.org> .../rxvt-unicode-9.22-sgr-mouse-mode-flag.patch | 165 +++++++++++++++++++++ x11-terms/rxvt-unicode/metadata.xml | 3 + x11-terms/rxvt-unicode/rxvt-unicode-9.22-r7.ebuild | 112 ++++++++++++++ 3 files changed, 280 insertions(+)