1
0
forked from aniani/vim

patch 8.1.1198: bracketed paste may remain active after Vim exists

Problem:    Bracketed paste may remain active after Vim exists, because the
            terminal emulater restores the setting.
Solution:   Set/reset bracketed paste mode before setting the terminal mode.
            (closes #3579)
This commit is contained in:
Bram Moolenaar
2019-04-21 17:22:33 +02:00
parent c75e812623
commit 958eabe5e5
2 changed files with 13 additions and 7 deletions

View File

@@ -3496,19 +3496,23 @@ settmode(int tmode)
#endif
#ifdef FEAT_MOUSE_TTY
if (tmode != TMODE_RAW)
mch_setmouse(FALSE); /* switch mouse off */
mch_setmouse(FALSE); // switch mouse off
#endif
if (tmode != TMODE_RAW)
out_str(T_BD); /* disable bracketed paste mode */
if (termcap_active)
{
if (tmode != TMODE_RAW)
out_str(T_BD); // disable bracketed paste mode
else
out_str(T_BE); // enable bracketed paste mode (should
// be before mch_settmode().
}
out_flush();
mch_settmode(tmode); /* machine specific function */
mch_settmode(tmode); // machine specific function
cur_tmode = tmode;
#ifdef FEAT_MOUSE
if (tmode == TMODE_RAW)
setmouse(); /* may switch mouse on */
setmouse(); // may switch mouse on
#endif
if (tmode == TMODE_RAW)
out_str(T_BE); /* enable bracketed paste mode */
out_flush();
}
#ifdef FEAT_TERMRESPONSE

View File

@@ -771,6 +771,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1198,
/**/
1197,
/**/