0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -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)
{
tmode_T old_tmode;
int call_settmode;
#ifdef FEAT_MZSCHEME
long total = msec; // remember original value
#endif
@@ -596,10 +597,13 @@ mch_delay(long msec, int flags)
// shell may produce SIGQUIT).
// Only do this if sleeping for more than half a second.
in_mch_delay = TRUE;
old_tmode = mch_cur_tmode;
if (mch_cur_tmode == TMODE_RAW
&& (msec > 500 || (flags & MCH_DELAY_SETTMODE)))
call_settmode = mch_cur_tmode == TMODE_RAW
&& (msec > 500 || (flags & MCH_DELAY_SETTMODE));
if (call_settmode)
{
old_tmode = mch_cur_tmode;
settmode(TMODE_SLEEP);
}
/*
* Everybody sleeps in a different way...
@@ -653,7 +657,7 @@ mch_delay(long msec, int flags)
while (total > 0);
#endif
if (msec > 500 || (flags & MCH_DELAY_SETTMODE))
if (call_settmode)
settmode(old_tmode);
in_mch_delay = FALSE;
}