patch 9.0.0653: BS and DEL do not work properly in an interacive shell
Problem: BS and DEL do not work properly in an interacive shell. (Gary
Johnson)
Solution: Adjust the length for replaced codes.
diff --git a/src/term.c b/src/term.c
index b7e3fac..c23b840 100644
--- a/src/term.c
+++ b/src/term.c
@@ -6733,11 +6733,13 @@
#endif
/*
- * Replace K_BS by <BS> and K_DEL by <DEL>
+ * Replace K_BS by <BS> and K_DEL by <DEL>.
+ * Returns "len" adjusted for replaced codes.
*/
- void
-term_replace_bs_del_keycode(char_u *ta_buf, int ta_len, int len)
+ int
+term_replace_bs_del_keycode(char_u *ta_buf, int ta_len, int len_arg)
{
+ int len = len_arg;
int i;
int c;
@@ -6762,4 +6764,5 @@
if (has_mbyte)
i += (*mb_ptr2len_len)(ta_buf + i, ta_len + len - i) - 1;
}
+ return len;
}