Mercurial > vim
comparison src/term.c @ 15111:6fcfff2b4ba5 v8.1.0566
patch 8.1.0566: SGR not enabled for mintty because $TERM is "xterm"
commit https://github.com/vim/vim/commit/20091c18c40b4e8b594769ba11e81d133c479d7c
Author: Bram Moolenaar <Bram@vim.org>
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 07 Dec 2018 13:30:07 +0100 |
parents | cf4d6489c9eb |
children | 55ccc2d353bd |
comparison
equal
deleted
inserted
replaced
15110:004ab96707d4 | 15111:6fcfff2b4ba5 |
---|---|
4696 if (tp[1 + (tp[0] != CSI)] == '>' && semicols == 2) | 4696 if (tp[1 + (tp[0] != CSI)] == '>' && semicols == 2) |
4697 { | 4697 { |
4698 int need_flush = FALSE; | 4698 int need_flush = FALSE; |
4699 # ifdef FEAT_MOUSE_SGR | 4699 # ifdef FEAT_MOUSE_SGR |
4700 int is_iterm2 = FALSE; | 4700 int is_iterm2 = FALSE; |
4701 int is_mintty = FALSE; | |
4702 | |
4703 // mintty 2.9.5 sends 77;20905;0c. | |
4704 // (77 is ASCII 'M' for mintty.) | |
4705 if (STRNCMP(tp + extra - 3, "77;", 3) == 0) | |
4706 is_mintty = TRUE; | |
4701 # endif | 4707 # endif |
4702 | 4708 |
4703 /* if xterm version >= 141 try to get termcap codes */ | 4709 /* if xterm version >= 141 try to get termcap codes */ |
4704 if (version >= 141) | 4710 if (version >= 141) |
4705 { | 4711 { |
4749 * by the user already. */ | 4755 * by the user already. */ |
4750 if (!option_was_set((char_u *)"ttym")) | 4756 if (!option_was_set((char_u *)"ttym")) |
4751 { | 4757 { |
4752 # ifdef FEAT_MOUSE_SGR | 4758 # ifdef FEAT_MOUSE_SGR |
4753 /* Xterm version 277 supports SGR. Also support | 4759 /* Xterm version 277 supports SGR. Also support |
4754 * Terminal.app and iTerm2. */ | 4760 * Terminal.app, iTerm2 and mintty. */ |
4755 if (version >= 277 || is_iterm2 || is_mac_terminal) | 4761 if (version >= 277 || is_iterm2 || is_mac_terminal |
4762 || is_mintty) | |
4756 set_option_value((char_u *)"ttym", 0L, | 4763 set_option_value((char_u *)"ttym", 0L, |
4757 (char_u *)"sgr", 0); | 4764 (char_u *)"sgr", 0); |
4758 else | 4765 else |
4759 # endif | 4766 # endif |
4760 /* if xterm version >= 95 use mouse dragging */ | 4767 /* if xterm version >= 95 use mouse dragging */ |