]> granicus.if.org Git - vim/commitdiff
patch 9.0.1063: when using Kitty a shell command may mess up the key state v9.0.1063
authorBram Moolenaar <Bram@vim.org>
Fri, 16 Dec 2022 13:08:36 +0000 (13:08 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 16 Dec 2022 13:08:36 +0000 (13:08 +0000)
Problem:    When using Kitty a shell command may mess up the key protocol
            state.
Solution:   Output t_te before t_TE.  If t_te switches between the main and
            the alternate screen then deactivating the key protocol by t_TE
            should happen after switching screen. (issue #11705)

src/term.c
src/version.c

index 13e3709fb482d3f7821f1125b65ff93d9e474d6f..777c510e8619e7d70a26901385d9e0bed7b6c94f 100644 (file)
@@ -3891,10 +3891,13 @@ stoptermcap(void)
        out_str(T_KE);                  // stop "keypad transmit" mode
        out_flush();
        termcap_active = FALSE;
+
+       // Output t_te first, it may switch between main and alternate screen,
+       // and following codes may work on the active screen only.
+       out_str(T_TE);                  // stop termcap mode
        cursor_on();                    // just in case it is still off
        out_str_t_TE();                 // stop "raw" mode, modifyOtherKeys and
                                        // Kitty keyboard protocol
-       out_str(T_TE);                  // stop termcap mode
        screen_start();                 // don't know where cursor is now
        out_flush();
     }
index 097c0a6a23147df0dcdd9e6b3f62a0fd9a79b4e8..316d21313c342a58d6c9238b7b6b082236715e92 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1063,
 /**/
     1062,
 /**/