comparison src/os_unix.c @ 6102:3d206df5c828 v7.4.389

updated for version 7.4.389 Problem: Still sometimes Vim enters Replace mode when starting up. Solution: Use a different solution in detecting the termresponse and location response. (Hayaki Saito)
author Bram Moolenaar <bram@vim.org>
date Wed, 30 Jul 2014 17:21:58 +0200
parents 182c7b987283
children 96a4fa8e530c
comparison
equal deleted inserted replaced
6101:d59994b0d90c 6102:3d206df5c828
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
3672 # ifdef FEAT_MOUSE_XTERM 3670 # ifdef FEAT_MOUSE_XTERM
3673 if (use_xterm_mouse() 3671 if (use_xterm_mouse()
3674 # ifdef FEAT_MOUSE_URXVT 3672 # ifdef FEAT_MOUSE_URXVT
3675 && use_xterm_mouse() != 3 3673 && use_xterm_mouse() != 3
3676 # endif 3674 # endif
3711 ) 3709 )
3712 set_mouse_termcode(KS_MOUSE, (char_u *)IF_EB("\033MS", ESC_STR "MS")); 3710 set_mouse_termcode(KS_MOUSE, (char_u *)IF_EB("\033MS", ESC_STR "MS"));
3713 # endif 3711 # endif
3714 3712
3715 # ifdef FEAT_MOUSE_JSB 3713 # ifdef FEAT_MOUSE_JSB
3716 /* There is no conflict, but it was disabled for xterm before. */ 3714 /* Conflicts with xterm mouse: "\033[" and "\033[M" ??? */
3717 if (!use_xterm_mouse() 3715 if (!use_xterm_mouse()
3718 # ifdef FEAT_GUI 3716 # ifdef FEAT_GUI
3719 && !gui.in_use 3717 && !gui.in_use
3720 # endif 3718 # endif
3721 ) 3719 )
3738 else 3736 else
3739 del_mouse_termcode(KS_NETTERM_MOUSE); 3737 del_mouse_termcode(KS_NETTERM_MOUSE);
3740 # endif 3738 # endif
3741 3739
3742 # ifdef FEAT_MOUSE_DEC 3740 # ifdef FEAT_MOUSE_DEC
3743 /* Conflicts with xterm mouse: "\033[" and "\033[M". 3741 /* Conflicts with xterm mouse: "\033[" and "\033[M" */
3744 * Also conflicts with the xterm termresponse, skip this if it was
3745 * requested already. */
3746 if (!use_xterm_mouse() 3742 if (!use_xterm_mouse()
3747 # ifdef FEAT_TERMRESPONSE
3748 && !did_request_esc_sequence()
3749 # endif
3750 # ifdef FEAT_GUI 3743 # ifdef FEAT_GUI
3751 && !gui.in_use 3744 && !gui.in_use
3752 # endif 3745 # endif
3753 ) 3746 )
3754 {
3755 set_mouse_termcode(KS_DEC_MOUSE, (char_u *)(term_is_8bit(T_NAME) 3747 set_mouse_termcode(KS_DEC_MOUSE, (char_u *)(term_is_8bit(T_NAME)
3756 ? IF_EB("\233", CSI_STR) : IF_EB("\033[", ESC_STR "["))); 3748 ? IF_EB("\233", CSI_STR) : IF_EB("\033[", ESC_STR "[")));
3757 xterm_conflict_mouse = TRUE;
3758 }
3759 else 3749 else
3760 del_mouse_termcode(KS_DEC_MOUSE); 3750 del_mouse_termcode(KS_DEC_MOUSE);
3761 # endif 3751 # endif
3762 # ifdef FEAT_MOUSE_PTERM 3752 # ifdef FEAT_MOUSE_PTERM
3763 /* same as the dec mouse */ 3753 /* same conflict as the dec mouse */
3764 if (!use_xterm_mouse() 3754 if (!use_xterm_mouse()
3765 # ifdef FEAT_TERMRESPONSE
3766 && !did_request_esc_sequence()
3767 # endif
3768 # ifdef FEAT_GUI 3755 # ifdef FEAT_GUI
3769 && !gui.in_use 3756 && !gui.in_use
3770 # endif 3757 # endif
3771 ) 3758 )
3772 {
3773 set_mouse_termcode(KS_PTERM_MOUSE, 3759 set_mouse_termcode(KS_PTERM_MOUSE,
3774 (char_u *) IF_EB("\033[", ESC_STR "[")); 3760 (char_u *) IF_EB("\033[", ESC_STR "["));
3775 xterm_conflict_mouse = TRUE;
3776 }
3777 else 3761 else
3778 del_mouse_termcode(KS_PTERM_MOUSE); 3762 del_mouse_termcode(KS_PTERM_MOUSE);
3779 # endif 3763 # endif
3780 # ifdef FEAT_MOUSE_URXVT 3764 # ifdef FEAT_MOUSE_URXVT
3781 /* same as the dec mouse */ 3765 /* same conflict as the dec mouse */
3782 if (use_xterm_mouse() == 3 3766 if (use_xterm_mouse() == 3
3783 # ifdef FEAT_GUI 3767 # ifdef FEAT_GUI
3784 && !gui.in_use 3768 && !gui.in_use
3785 # endif 3769 # endif
3786 ) 3770 )
3792 if (*p_mouse != NUL) 3776 if (*p_mouse != NUL)
3793 { 3777 {
3794 mch_setmouse(FALSE); 3778 mch_setmouse(FALSE);
3795 setmouse(); 3779 setmouse();
3796 } 3780 }
3797 /* It's OK to request the xterm version for uxterm. */
3798 resume_get_esc_sequence();
3799 } 3781 }
3800 else 3782 else
3801 del_mouse_termcode(KS_URXVT_MOUSE); 3783 del_mouse_termcode(KS_URXVT_MOUSE);
3802 # endif 3784 # endif
3803 # ifdef FEAT_MOUSE_SGR 3785 # ifdef FEAT_MOUSE_SGR