# HG changeset patch # User Bram Moolenaar # Date 1544185807 -3600 # Node ID 6fcfff2b4ba53a73915e213ed1556f18a5889362 # Parent 004ab96707d4e9b7c6a999ca4199633b214a922b patch 8.1.0566: SGR not enabled for mintty because $TERM is "xterm" commit https://github.com/vim/vim/commit/20091c18c40b4e8b594769ba11e81d133c479d7c Author: Bram Moolenaar Date: Fri Dec 7 13:18:19 2018 +0100 patch 8.1.0566: SGR not enabled for mintty because $TERM is "xterm" Problem: SGR not enabled for mintty because $TERM is "xterm". Solution: Detect mintty by the termresponse. (Ken Takata, closes https://github.com/vim/vim/issues/3667) diff --git a/src/term.c b/src/term.c --- a/src/term.c +++ b/src/term.c @@ -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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -793,6 +793,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 566, +/**/ 565, /**/ 564,