bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SGR mouse only if term_names =~ xterm?


From: Thomas Dickey
Subject: Re: SGR mouse only if term_names =~ xterm?
Date: Mon, 19 Nov 2018 19:36:01 -0500
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Nov 19, 2018 at 07:27:44PM +0100, Tomas Janousek wrote:
> Hi Thomas and others,
> 
> I patched my local rxvt-unicode with SGR (1006) mouse support but I had
> trouble getting it to work in ncurses even though I set correct kmous, xm and
> XM in terminfo. Turns out there's this code in ncurses/base/lib_mouse.c:
> 
>     /* we know how to recognize mouse events under "xterm" */
>     if (key_mouse != 0) {
>         if (!strcmp(key_mouse, xterm_kmous)
>             || strstr(SP_TERMTYPE term_names, "xterm") != 0) {
>             init_xterm_mouse(sp);
>         }
>     } else if (strstr(SP_TERMTYPE term_names, "xterm") != 0) {
>         if (_nc_add_to_try(&(sp->_keytry), xterm_kmous, KEY_MOUSE) == OK)
>             init_xterm_mouse(sp);
>     }
> 
> which essentially means:
> 
>     either kmous = \E[M or term_names =~ /xterm/
>     otherwise no mouse support
> 
> So to get it working, I had to mention "xterm" in the terminfo entry:
> 
>     rxvt-unicode-256color|rxvt-unicode terminal with 256 colors (X Window 
> System) + xterm+sm+1006,
> 
> (And then I had to do the same for tmux-256color. If anyone's interested, I
> ended up with 
> https://github.com/liskin/dotfiles/blob/fec60081b77b254bd0aaf1f471335fa6bb5dc206/.terminfo/terminfo.src)
> 
> Is that intentional? There are multiple terminfo entries in misc/terminfo.src

not really intentional (just overlooked).  Generally when I'm testing the
variants, that's using tack (which doesn't test the mouse).

For testing the mouse features, I used vttest.  So there's a blind spot,
which would be filled in if there were cooperative terminal developers.
There're not many of those :-)

...will fix (thanks)

> that use=xterm+sm+1006 but don't include "xterm" in their name (like vte-2014,
> nsterm-build400, teraterm4.97) and I suspect mouse won't work in these either.
> Indeed, using TERM=vte in gnome-terminal, mouse is non-functional in ncurses
> apps. It does work with with TERM=vte-256color, though, because the longname
> of that is "VTE with xterm 256-colors".
> 
> -- 
> Tomáš Janoušek, a.k.a. Pivník, a.k.a. Liskni_si, http://work.lisk.in/
> 
> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-ncurses

-- 
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]