]> granicus.if.org Git - vim/commitdiff
patch 8.1.0566: SGR not enabled for mintty because $TERM is "xterm" v8.1.0566
authorBram Moolenaar <Bram@vim.org>
Fri, 7 Dec 2018 12:18:19 +0000 (13:18 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 7 Dec 2018 12:18:19 +0000 (13:18 +0100)
Problem:    SGR not enabled for mintty because $TERM is "xterm".
Solution:   Detect mintty by the termresponse. (Ken Takata, closes #3667)

src/term.c
src/version.c

index 4dfb97e74c367892758f7eddbadb58ca014329d5..131e31bc7230c4edce44af869c98c68f06d5420c 100644 (file)
@@ -4698,6 +4698,12 @@ check_termcode(
                        int need_flush = FALSE;
 # ifdef FEAT_MOUSE_SGR
                        int is_iterm2 = FALSE;
+                       int is_mintty = FALSE;
+
+                       // mintty 2.9.5 sends 77;20905;0c.
+                       // (77 is ASCII 'M' for mintty.)
+                       if (STRNCMP(tp + extra - 3, "77;", 3) == 0)
+                           is_mintty = TRUE;
 # endif
 
                        /* if xterm version >= 141 try to get termcap codes */
@@ -4751,8 +4757,9 @@ check_termcode(
                        {
 # ifdef FEAT_MOUSE_SGR
                            /* Xterm version 277 supports SGR.  Also support
-                            * Terminal.app and iTerm2. */
-                           if (version >= 277 || is_iterm2 || is_mac_terminal)
+                            * Terminal.app, iTerm2 and mintty. */
+                           if (version >= 277 || is_iterm2 || is_mac_terminal
+                                   || is_mintty)
                                set_option_value((char_u *)"ttym", 0L,
                                                          (char_u *)"sgr", 0);
                            else
index e4f863eaf11cbecb96365bff21708f9992b6397e..b912a6eec87be6dc846414516c8b82fbdf7f1754 100644 (file)
@@ -792,6 +792,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    566,
 /**/
     565,
 /**/