patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter

Problem:    A custom 'tabline' may cause Esc to work like Enter on the
            command line when the popup menu is displayed.
Solution:   Save and restore KeyTyped. (closes #9776)
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index fb1976a..76a5c7c 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -2107,6 +2107,15 @@
       set statusline=%!MyStatusLine()
       set laststatus=2
     endfunc
+
+    func MyTabLine()
+      return 'my tab line'
+    endfunc
+    func SetupTabline()
+      set statusline=
+      set tabline=%!MyTabLine()
+      set showtabline=2
+    endfunc
   [CODE]
   call writefile(commands, 'Xtest')
 
@@ -2298,6 +2307,12 @@
   call term_sendkeys(buf, "\<Esc>")
   call VerifyScreenDump(buf, 'Test_wildmenu_pum_39', {})
 
+  " Esc still works to abort the command when 'tabline' is set
+  call term_sendkeys(buf, ":call SetupTabline()\<CR>")
+  call term_sendkeys(buf, ":si\<Tab>")
+  call term_sendkeys(buf, "\<Esc>")
+  call VerifyScreenDump(buf, 'Test_wildmenu_pum_40', {})
+
   call term_sendkeys(buf, "\<C-U>\<CR>")
   call StopVimInTerminal(buf)
   call delete('Xtest')