]> granicus.if.org Git - vim/commitdiff
patch 8.2.1805: Unix: terminal mode changed when using ":shell" v8.2.1805
authorBram Moolenaar <Bram@vim.org>
Mon, 5 Oct 2020 19:39:25 +0000 (21:39 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 5 Oct 2020 19:39:25 +0000 (21:39 +0200)
Problem:    Unix: terminal mode changed when using ":shell".
Solution:   Avoid calling settmode() when not needed. (issue #7079)

src/os_unix.c
src/version.c

index 6f7a9a4cf910f655cbf51f4b0306be039cef6aee..2afe1ba936e5c3f53a74e46a6db8c31dce04f9c1 100644 (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;
     }
index cfd0d5458ac5038998aafffdb0eede6fe38ff526..b8b9917d069b1de47370d37cec195fc674fa6952 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1805,
 /**/
     1804,
 /**/