diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-10-05 21:39:25 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-10-05 21:39:25 +0200 |
commit | 80361a5f2b134c88597d60b3d363b52084e712a1 (patch) | |
tree | 0bfcfbe561c9590c0fc5bed55f6d561c489f943b | |
parent | 50c4e9e08fb0981892e33afb9fe3751aa6df1fa4 (diff) |
patch 8.2.1805: Unix: terminal mode changed when using ":shell"v8.2.1805
Problem: Unix: terminal mode changed when using ":shell".
Solution: Avoid calling settmode() when not needed. (issue #7079)
-rw-r--r-- | src/os_unix.c | 12 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 6f7a9a4cf9..2afe1ba936 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -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; } diff --git a/src/version.c b/src/version.c index cfd0d5458a..b8b9917d06 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1805, +/**/ 1804, /**/ 1803, |