summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-03 20:24:39 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-03 20:24:39 +0100
commit01c34e7d10e3dbd73d18a3dd79a48748c4147eaf (patch)
treeca71ff2c5e6dd418b009f9de330142e7c0b4c4c2
parentb6aab8f44beb8c5d99393abdc2c9faab085c72aa (diff)
patch 9.0.0653: BS and DEL do not work properly in an interacive shellv9.0.0653
Problem: BS and DEL do not work properly in an interacive shell. (Gary Johnson) Solution: Adjust the length for replaced codes.
-rw-r--r--src/os_unix.c2
-rw-r--r--src/os_win32.c2
-rw-r--r--src/proto/term.pro2
-rw-r--r--src/term.c9
-rw-r--r--src/version.c2
5 files changed, 11 insertions, 6 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index e86e308370..20e979c158 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5106,7 +5106,7 @@ mch_call_shell_fork(
}
}
- term_replace_bs_del_keycode(ta_buf, ta_len, len);
+ len = term_replace_bs_del_keycode(ta_buf, ta_len, len);
/*
* For pipes: echo the typed characters.
diff --git a/src/os_win32.c b/src/os_win32.c
index 5d544b2413..644e647521 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -4531,7 +4531,7 @@ mch_system_piped(char *cmd, int options)
}
}
- term_replace_bs_del_keycode(ta_buf, ta_len, len);
+ len = term_replace_bs_del_keycode(ta_buf, ta_len, len);
/*
* For pipes: echo the typed characters. For a pty this
diff --git a/src/proto/term.pro b/src/proto/term.pro
index 8c56f62bd7..13a093c882 100644
--- a/src/proto/term.pro
+++ b/src/proto/term.pro
@@ -86,5 +86,5 @@ void update_tcap(int attr);
void swap_tcap(void);
void ansi_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx);
void cterm_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx);
-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);
/* vim: set ft=c : */
diff --git a/src/term.c b/src/term.c
index b7e3facdb1..c23b840d1f 100644
--- a/src/term.c
+++ b/src/term.c
@@ -6733,11 +6733,13 @@ cterm_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx)
#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 @@ term_replace_bs_del_keycode(char_u *ta_buf, int ta_len, int len)
if (has_mbyte)
i += (*mb_ptr2len_len)(ta_buf + i, ta_len + len - i) - 1;
}
+ return len;
}
diff --git a/src/version.c b/src/version.c
index abc67c0c4a..686b52581a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -700,6 +700,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 653,
+/**/
652,
/**/
651,