diff src/terminal.c @ 13344:68c4fc9ae216 v8.0.1546

patch 8.0.1546: using feedkeys() in a terminal may trigger mappings commit https://github.com/vim/vim/commit/c8bcfe7efd4cfdfd7f503700aba45c42765cd4dc Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 27 16:29:28 2018 +0100 patch 8.0.1546: using feedkeys() in a terminal may trigger mappings Problem: Using feedkeys() in a terminal window may trigger mappings. (Charles Sheridan) Solution: Avoid triggering a mapping when peeking for a key.
author Christian Brabandt <cb@256bit.org>
date Tue, 27 Feb 2018 16:30:05 +0100
parents 73325d39591a
children 69517d67421f
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1306,10 +1306,9 @@ term_enter_job_mode()
 }
 
 /*
- * Get a key from the user without mapping.
+ * Get a key from the user with terminal mode mappings.
  * Note: while waiting a terminal may be closed and freed if the channel is
  * closed and ++close was used.
- * Uses terminal mode mappings.
  */
     static int
 term_vgetc()
@@ -1633,7 +1632,7 @@ terminal_loop(int blocking)
     position_cursor(curwin, &curbuf->b_term->tl_cursor_pos);
     may_set_cursor_props(curbuf->b_term);
 
-    while (blocking || vpeekc() != NUL)
+    while (blocking || vpeekc_nomap() != NUL)
     {
 	/* TODO: skip screen update when handling a sequence of keys. */
 	/* Repeat redrawing in case a message is received while redrawing. */