summaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-17 16:40:31 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-17 16:40:31 +0200
commit314ca7cbb4b5a26959abb641a5aa265bee47abe5 (patch)
tree031e875a2f097f46667d99b9879a74fcc13487f7 /src/term.c
parent21cfe500f322a0bea3367c677943ea6c57c282b9 (diff)
downloadvim-git-314ca7cbb4b5a26959abb641a5aa265bee47abe5.tar.gz
patch 8.2.0588: Putty does not use "sgr" 'ttymouse' by defaultv8.2.0588
Problem: Putty does not use "sgr" 'ttymouse' by default. Solution: Make "sgr" the default for Putty. (Christian Brabandt, closes #5942)
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/term.c b/src/term.c
index ce935dcf4..ef91b8fac 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4762,15 +4762,14 @@ not_enough:
|| (is_screen && arg[1] >= 40700))
set_option_value((char_u *)"ttym", 0L,
(char_u *)"sgr", 0);
- // if xterm version >= 95 use mouse dragging
+ // For xterm version >= 95 mouse dragging works.
else if (version >= 95)
set_option_value((char_u *)"ttym", 0L,
(char_u *)"xterm2", 0);
}
// Detect terminals that set $TERM to something like
- // "xterm-256colors" but are not fully xterm
- // compatible.
+ // "xterm-256color" but are not fully xterm compatible.
// Gnome terminal sends 1;3801;0, 1;4402;0 or 1;2501;0.
// xfce4-terminal sends 1;2802;0.
@@ -4783,8 +4782,18 @@ not_enough:
// PuTTY sends 0;136;0
// vandyke SecureCRT sends 1;136;0
else if (version == 136 && arg[2] == 0)
+ {
is_not_xterm = TRUE;
+ // PuTTY supports sgr-like mouse reporting, but
+ // only set 'ttymouse' if it was not set by the
+ // user already.
+ if (arg[0] == 0
+ && !option_was_set((char_u *)"ttym"))
+ set_option_value((char_u *)"ttym", 0L,
+ (char_u *)"sgr", 0);
+ }
+
// Konsole sends 0;115;0
else if (version == 115 && arg[0] == 0 && arg[2] == 0)
is_not_xterm = TRUE;