comparison src/os_unix.c @ 5927:63e7cc62402d v7.4.305

updated for version 7.4.305 Problem: Making 'ttymouse' empty after the xterm version was requested causes problems. (Elijah Griffin) Solution: Do not check for DEC mouse sequences when the xterm version was requested. Also don't request the xterm version when DEC mouse was enabled.
author Bram Moolenaar <bram@vim.org>
date Thu, 22 May 2014 18:14:31 +0200
parents 662ae48e7e24
children 06c10522d321
comparison
equal deleted inserted replaced
5926:492e4efff2ae 5927:63e7cc62402d
3665 * Set the mouse termcode, depending on the 'term' and 'ttymouse' options. 3665 * Set the mouse termcode, depending on the 'term' and 'ttymouse' options.
3666 */ 3666 */
3667 void 3667 void
3668 check_mouse_termcode() 3668 check_mouse_termcode()
3669 { 3669 {
3670 xterm_conflict_mouse = FALSE;
3671
3670 # ifdef FEAT_MOUSE_XTERM 3672 # ifdef FEAT_MOUSE_XTERM
3671 if (use_xterm_mouse() 3673 if (use_xterm_mouse()
3672 # ifdef FEAT_MOUSE_URXVT 3674 # ifdef FEAT_MOUSE_URXVT
3673 && use_xterm_mouse() != 3 3675 && use_xterm_mouse() != 3
3674 # endif 3676 # endif
3709 ) 3711 )
3710 set_mouse_termcode(KS_MOUSE, (char_u *)IF_EB("\033MS", ESC_STR "MS")); 3712 set_mouse_termcode(KS_MOUSE, (char_u *)IF_EB("\033MS", ESC_STR "MS"));
3711 # endif 3713 # endif
3712 3714
3713 # ifdef FEAT_MOUSE_JSB 3715 # ifdef FEAT_MOUSE_JSB
3714 /* conflicts with xterm mouse: "\033[" and "\033[M" ??? */ 3716 /* There is no conflict, but it was disabled for xterm before. */
3715 if (!use_xterm_mouse() 3717 if (!use_xterm_mouse()
3716 # ifdef FEAT_GUI 3718 # ifdef FEAT_GUI
3717 && !gui.in_use 3719 && !gui.in_use
3718 # endif 3720 # endif
3719 ) 3721 )
3736 else 3738 else
3737 del_mouse_termcode(KS_NETTERM_MOUSE); 3739 del_mouse_termcode(KS_NETTERM_MOUSE);
3738 # endif 3740 # endif
3739 3741
3740 # ifdef FEAT_MOUSE_DEC 3742 # ifdef FEAT_MOUSE_DEC
3741 /* conflicts with xterm mouse: "\033[" and "\033[M" */ 3743 /* Conflicts with xterm mouse: "\033[" and "\033[M".
3742 if (!use_xterm_mouse() 3744 * Also conflicts with the xterm termresponse, skip this if it was
3745 * requested already. */
3746 if (!use_xterm_mouse() && !did_request_esc_sequence()
3743 # ifdef FEAT_GUI 3747 # ifdef FEAT_GUI
3744 && !gui.in_use 3748 && !gui.in_use
3745 # endif 3749 # endif
3746 ) 3750 )
3751 {
3747 set_mouse_termcode(KS_DEC_MOUSE, (char_u *)(term_is_8bit(T_NAME) 3752 set_mouse_termcode(KS_DEC_MOUSE, (char_u *)(term_is_8bit(T_NAME)
3748 ? IF_EB("\233", CSI_STR) : IF_EB("\033[", ESC_STR "["))); 3753 ? IF_EB("\233", CSI_STR) : IF_EB("\033[", ESC_STR "[")));
3754 xterm_conflict_mouse = TRUE;
3755 }
3749 else 3756 else
3750 del_mouse_termcode(KS_DEC_MOUSE); 3757 del_mouse_termcode(KS_DEC_MOUSE);
3751 # endif 3758 # endif
3752 # ifdef FEAT_MOUSE_PTERM 3759 # ifdef FEAT_MOUSE_PTERM
3753 /* same as the dec mouse */ 3760 /* same as the dec mouse */
3754 if (!use_xterm_mouse() 3761 if (!use_xterm_mouse() && !did_request_esc_sequence()
3755 # ifdef FEAT_GUI 3762 # ifdef FEAT_GUI
3756 && !gui.in_use 3763 && !gui.in_use
3757 # endif 3764 # endif
3758 ) 3765 )
3766 {
3759 set_mouse_termcode(KS_PTERM_MOUSE, 3767 set_mouse_termcode(KS_PTERM_MOUSE,
3760 (char_u *) IF_EB("\033[", ESC_STR "[")); 3768 (char_u *) IF_EB("\033[", ESC_STR "["));
3769 xterm_conflict_mouse = TRUE;
3770 }
3761 else 3771 else
3762 del_mouse_termcode(KS_PTERM_MOUSE); 3772 del_mouse_termcode(KS_PTERM_MOUSE);
3763 # endif 3773 # endif
3764 # ifdef FEAT_MOUSE_URXVT 3774 # ifdef FEAT_MOUSE_URXVT
3765 /* same as the dec mouse */ 3775 /* same as the dec mouse */
3766 if (use_xterm_mouse() == 3 3776 if (use_xterm_mouse() == 3 && !did_request_esc_sequence()
3767 # ifdef FEAT_GUI 3777 # ifdef FEAT_GUI
3768 && !gui.in_use 3778 && !gui.in_use
3769 # endif 3779 # endif
3770 ) 3780 )
3771 { 3781 {
3776 if (*p_mouse != NUL) 3786 if (*p_mouse != NUL)
3777 { 3787 {
3778 mch_setmouse(FALSE); 3788 mch_setmouse(FALSE);
3779 setmouse(); 3789 setmouse();
3780 } 3790 }
3791 xterm_conflict_mouse = TRUE;
3781 } 3792 }
3782 else 3793 else
3783 del_mouse_termcode(KS_URXVT_MOUSE); 3794 del_mouse_termcode(KS_URXVT_MOUSE);
3784 # endif 3795 # endif
3785 # ifdef FEAT_MOUSE_SGR 3796 # ifdef FEAT_MOUSE_SGR