0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.1805: Unix: terminal mode changed when using ":shell"

Problem:    Unix: terminal mode changed when using ":shell".
Solution:   Avoid calling settmode() when not needed. (issue #7079)
This commit is contained in:
Bram Moolenaar
2020-10-05 21:39:25 +02:00
parent 50c4e9e08f
commit 80361a5f2b
2 changed files with 10 additions and 4 deletions

View File

@@ -585,6 +585,7 @@ mch_total_mem(int special UNUSED)
mch_delay(long msec, int flags) mch_delay(long msec, int flags)
{ {
tmode_T old_tmode; tmode_T old_tmode;
int call_settmode;
#ifdef FEAT_MZSCHEME #ifdef FEAT_MZSCHEME
long total = msec; // remember original value long total = msec; // remember original value
#endif #endif
@@ -596,10 +597,13 @@ mch_delay(long msec, int flags)
// shell may produce SIGQUIT). // shell may produce SIGQUIT).
// Only do this if sleeping for more than half a second. // Only do this if sleeping for more than half a second.
in_mch_delay = TRUE; in_mch_delay = TRUE;
call_settmode = mch_cur_tmode == TMODE_RAW
&& (msec > 500 || (flags & MCH_DELAY_SETTMODE));
if (call_settmode)
{
old_tmode = mch_cur_tmode; old_tmode = mch_cur_tmode;
if (mch_cur_tmode == TMODE_RAW
&& (msec > 500 || (flags & MCH_DELAY_SETTMODE)))
settmode(TMODE_SLEEP); settmode(TMODE_SLEEP);
}
/* /*
* Everybody sleeps in a different way... * Everybody sleeps in a different way...
@@ -653,7 +657,7 @@ mch_delay(long msec, int flags)
while (total > 0); while (total > 0);
#endif #endif
if (msec > 500 || (flags & MCH_DELAY_SETTMODE)) if (call_settmode)
settmode(old_tmode); settmode(old_tmode);
in_mch_delay = FALSE; in_mch_delay = FALSE;
} }

View File

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