summaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-12-07 13:18:19 +0100
committerBram Moolenaar <Bram@vim.org>2018-12-07 13:18:19 +0100
commit20091c18c40b4e8b594769ba11e81d133c479d7c (patch)
tree3fd46048f9355294867a7bb0d6088fb86e711012 /src/term.c
parent10600db772a6b50093b8027509d7089c209d1e26 (diff)
downloadvim-git-20091c18c40b4e8b594769ba11e81d133c479d7c.tar.gz
patch 8.1.0566: SGR not enabled for mintty because $TERM is "xterm"v8.1.0566
Problem: SGR not enabled for mintty because $TERM is "xterm". Solution: Detect mintty by the termresponse. (Ken Takata, closes #3667)
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/term.c b/src/term.c
index 4dfb97e74..131e31bc7 100644
--- 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