Sorry for the repost; but I realized I should've drawn more attention to the message with the patch in it, both so other lurkers know the thread now includes a proposed patch, and so that we know what message to go back to if we want to refer to the code we're discussing.
I have made a slight adjustment to the patch, swapping the order of STRICMP and term_is_xterm within vim_uses_xterm_mouse(). I was using vim_is_xterm() instead of term_is_xterm at first, but afterwards replaced it for efficiency, but left the order as it was. -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/
Index: os_unix.c
===================================================================
--- os_unix.c (revision 276)
+++ os_unix.c (working copy)
@@ -2034,6 +2034,21 @@
|| STRCMP(name, "builtin_xterm") == 0);
}
+/*
+ * Return TRUE if "name" appears to be that of a terminal
+ * known to support the xterm-style mouse protocol.
+ * Relies on term_is_xterm having been set to its correct value.
+ */
+ int
+vim_uses_xterm_mouse(name)
+ char_u *name;
+{
+ if (name == NULL)
+ return FALSE;
+ return (term_is_xterm
+ || STRNICMP(name, "screen", 6) == 0);
+}
+
#if defined(FEAT_MOUSE_TTY) || defined(PROTO)
/*
* Return non-zero when using an xterm mouse, according to 'ttymouse'.
Index: term.c
===================================================================
--- term.c (revision 276)
+++ term.c (working copy)
@@ -1601,6 +1601,9 @@
int try;
int termcap_cleared = FALSE;
#endif
+#if defined(UNIX) || defined(VMS)
+ int term_uses_xterm_mouse;
+#endif
int width = 0, height = 0;
char_u *error_msg = NULL;
char_u *bs_p, *del_p;
@@ -1903,6 +1906,7 @@
#if defined(UNIX) || defined(VMS)
term_is_xterm = vim_is_xterm(term);
+ term_uses_xterm_mouse = vim_uses_xterm_mouse(term);
#endif
#ifdef FEAT_MOUSE
@@ -1923,7 +1927,7 @@
# endif
clip_init(FALSE);
# endif
- if (term_is_xterm)
+ if (term_uses_xterm_mouse)
{
if (use_xterm_mouse())
p = NULL; /* keep existing value, might be "xterm2" */
signature.asc
Description: PGP signature
signature.asc
Description: OpenPGP digital signature
