Mercurial > vim
diff src/os_unix.c @ 11557:7e5e76d8d451 v8.0.0661
patch 8.0.0661: recognizing urxvt mouse codes does not work well
commit https://github.com/vim/vim/commit/a529ce068ba84d53343f3732b6a1ed4ad1fe3a68
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jun 22 22:37:57 2017 +0200
patch 8.0.0661: recognizing urxvt mouse codes does not work well
Problem: Recognizing urxvt mouse codes does not work well.
Solution: Recognize "Esc[*M" and "Esc[*m". (Maurice Bos, closes https://github.com/vim/vim/issues/1486)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 22 Jun 2017 22:45:04 +0200 |
parents | 2e6a0ea76a0d |
children | 2ec27561dd76 |
line wrap: on
line diff
--- a/src/os_unix.c +++ b/src/os_unix.c @@ -3771,7 +3771,6 @@ check_mouse_termcode(void) del_mouse_termcode(KS_PTERM_MOUSE); # endif # ifdef FEAT_MOUSE_URXVT - /* same conflict as the dec mouse */ if (use_xterm_mouse() == 3 # ifdef FEAT_GUI && !gui.in_use @@ -3779,8 +3778,8 @@ check_mouse_termcode(void) ) { set_mouse_termcode(KS_URXVT_MOUSE, (char_u *)(term_is_8bit(T_NAME) - ? IF_EB("\233", CSI_STR) - : IF_EB("\033[", ESC_STR "["))); + ? IF_EB("\233*M", CSI_STR "*M") + : IF_EB("\033[*M", ESC_STR "[*M"))); if (*p_mouse != NUL) { @@ -3792,7 +3791,6 @@ check_mouse_termcode(void) del_mouse_termcode(KS_URXVT_MOUSE); # endif # ifdef FEAT_MOUSE_SGR - /* There is no conflict with xterm mouse */ if (use_xterm_mouse() == 4 # ifdef FEAT_GUI && !gui.in_use @@ -3800,8 +3798,12 @@ check_mouse_termcode(void) ) { set_mouse_termcode(KS_SGR_MOUSE, (char_u *)(term_is_8bit(T_NAME) - ? IF_EB("\233<", CSI_STR "<") - : IF_EB("\033[<", ESC_STR "[<"))); + ? IF_EB("\233<*M", CSI_STR "<*M") + : IF_EB("\033[<*M", ESC_STR "[<*M"))); + + set_mouse_termcode(KS_SGR_MOUSE_RELEASE, (char_u *)(term_is_8bit(T_NAME) + ? IF_EB("\233<*m", CSI_STR "<*m") + : IF_EB("\033[<*m", ESC_STR "[<*m"))); if (*p_mouse != NUL) { @@ -3810,7 +3812,10 @@ check_mouse_termcode(void) } } else + { del_mouse_termcode(KS_SGR_MOUSE); + del_mouse_termcode(KS_SGR_MOUSE_RELEASE); + } # endif } #endif