commit 97a993d40159beb27604eb161fa48d626f548568
parent 1542cbf942af9b39c39775fbcde5c1d75326e08a
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 8 Jul 2020 16:14:08 +0200
verbatim: turn bracketed-paste mode off while waiting for input
This allows pasting six hexadecimal digits after typing M-V
in order to enter a specific Unicode character.
This fixes https://savannah.gnu.org/bugs/?58730.
Bug existed since version 4.8, since bracketed pastes
were introduced in commit f705a967.
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -1545,6 +1545,12 @@ char *get_verbatim_kbinput(WINDOW *win, size_t *count)
if (!ISSET(RAW_SEQUENCES))
keypad(win, FALSE);
+#ifndef NANO_TINY
+ /* Turn bracketed-paste mode off. */
+ printf("\e[?2004l");
+ fflush(stdout);
+#endif
+
/* Read in a single byte or two escapes. */
input = parse_verbatim_kbinput(win, count);
@@ -1560,6 +1566,12 @@ char *get_verbatim_kbinput(WINDOW *win, size_t *count)
}
}
+#ifndef NANO_TINY
+ /* Turn bracketed-paste mode back on. */
+ printf("\e[?2004h");
+ fflush(stdout);
+#endif
+
/* Turn flow control characters back on if necessary and turn the
* keypad back on if necessary now that we're done. */
if (ISSET(PRESERVE))