patch 8.1.0032: BS in prompt buffer starts new line
Problem: BS in prompt buffer starts new line.
Solution: Do not allows BS over the prompt. Make term_sendkeys() handle
special keys. Add a test.
diff --git a/src/terminal.c b/src/terminal.c
index 6967df7..275a5a7 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -5094,8 +5094,19 @@
while (*msg != NUL)
{
- send_keys_to_term(term, PTR2CHAR(msg), FALSE);
- msg += MB_CPTR2LEN(msg);
+ int c;
+
+ if (*msg == K_SPECIAL && msg[1] != NUL && msg[2] != NUL)
+ {
+ c = TO_SPECIAL(msg[1], msg[2]);
+ msg += 3;
+ }
+ else
+ {
+ c = PTR2CHAR(msg);
+ msg += MB_CPTR2LEN(msg);
+ }
+ send_keys_to_term(term, c, FALSE);
}
}