summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-11-16 22:07:13 +0100
committerBram Moolenaar <Bram@vim.org>2017-11-16 22:07:13 +0100
commit9c6ce0e62297294b41344e684429a91853bc2268 (patch)
tree1d3ce62de227de72af7d29466102b5328044d908 /src
parent209d3874c19d73b209e7d223cf05ea22e183f408 (diff)
downloadvim-git-9c6ce0e62297294b41344e684429a91853bc2268.tar.gz
patch 8.0.1303: 'ttymouse' is not set to "sgr" for Terminal.app and Iterm2v8.0.1303
Problem: 'ttymouse' is not set to "sgr" for Terminal.app and Iterm2. Solution: Recognize Iterm2 by the termresponse.
Diffstat (limited to 'src')
-rw-r--r--src/term.c30
-rw-r--r--src/version.c2
2 files changed, 23 insertions, 9 deletions
diff --git a/src/term.c b/src/term.c
index ef88705ff..83b54e18c 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4546,6 +4546,9 @@ check_termcode(
if (tp[1 + (tp[0] != CSI)] == '>' && semicols == 2)
{
int need_flush = FALSE;
+# ifdef FEAT_MOUSE_SGR
+ int is_iterm2 = FALSE;
+# endif
/* if xterm version >= 141 try to get termcap codes */
if (version >= 141)
@@ -4573,12 +4576,29 @@ check_termcode(
# endif
}
+ if (version == 95)
+ {
+ /* Mac Terminal.app sends 1;95;0 */
+ if (STRNCMP(tp + extra - 2, "1;95;0c", 7) == 0)
+ {
+ is_not_xterm = TRUE;
+ is_mac_terminal = TRUE;
+ }
+# ifdef FEAT_MOUSE_SGR
+ /* Iterm2 sends 0;95;0 */
+ if (STRNCMP(tp + extra - 2, "0;95;0c", 7) == 0)
+ is_iterm2 = TRUE;
+# endif
+ }
+
/* Only set 'ttymouse' automatically if it was not set
* by the user already. */
if (!option_was_set((char_u *)"ttym"))
{
# ifdef FEAT_MOUSE_SGR
- if (version >= 277)
+ /* Xterm version 277 supports SGR. Also support
+ * Terminal.app and iterm2. */
+ if (version >= 277 || is_iterm2 || is_mac_terminal)
set_option_value((char_u *)"ttym", 0L,
(char_u *)"sgr", 0);
else
@@ -4593,14 +4613,6 @@ check_termcode(
* "xterm-256colors" but are not fully xterm
* compatible. */
- /* Mac Terminal.app sends 1;95;0 */
- if (version == 95
- && STRNCMP(tp + extra - 2, "1;95;0c", 7) == 0)
- {
- is_not_xterm = TRUE;
- is_mac_terminal = TRUE;
- }
-
/* Gnome terminal sends 1;3801;0, 1;4402;0 or 1;2501;0.
* xfce4-terminal sends 1;2802;0.
* screen sends 83;40500;0
diff --git a/src/version.c b/src/version.c
index e38c18820..2789f2bde 100644
--- a/src/version.c
+++ b/src/version.c
@@ -767,6 +767,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1303,
+/**/
1302,
/**/
1301,