updated for version 7.0177
diff --git a/src/term.c b/src/term.c
index a52e3fa..cc3c036 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3256,6 +3256,8 @@
* echoed.
* Only do this after termcap mode has been started, otherwise the codes for
* the cursor keys may be wrong.
+ * Only do this when 'esckeys' is on, otherwise the response causes trouble in
+ * Insert mode.
* On Unix only do it when both output and input are a tty (avoid writing
* request to terminal while reading from a file).
* The result is caught in check_termcode().
@@ -3266,6 +3268,7 @@
if (crv_status == CRV_GET
&& cur_tmode == TMODE_RAW
&& termcap_active
+ && p_ek
#ifdef UNIX
&& isatty(1)
&& isatty(read_cmd_fd)