From: Xueming Li Date: Thu, 7 Dec 2017 14:52:02 +0000 (+0800) Subject: cmdline: support backspace key X-Git-Tag: spdx-start~695 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c89dc62533ac3b8a09e3b9f07a2aa1780ac7118a;p=dpdk.git cmdline: support backspace key Support windows putty "\b"(Ctrl-H) backspace key. Signed-off-by: Xueming Li Acked-by: Olivier Matz --- diff --git a/lib/librte_cmdline/cmdline_rdline.c b/lib/librte_cmdline/cmdline_rdline.c index 1ef2258d00..a1aa88c963 100644 --- a/lib/librte_cmdline/cmdline_rdline.c +++ b/lib/librte_cmdline/cmdline_rdline.c @@ -331,6 +331,7 @@ rdline_char_in(struct rdline *rdl, char c) /* delete 1 char from the left */ case CMDLINE_KEY_BKSPACE: + case CMDLINE_KEY_BKSPACE2: if(!cirbuf_del_tail_safe(&rdl->left)) { rdline_puts(rdl, vt100_bs); display_right_buffer(rdl, 1); diff --git a/lib/librte_cmdline/cmdline_vt100.c b/lib/librte_cmdline/cmdline_vt100.c index a253e8b6c5..c7b8e60bd0 100644 --- a/lib/librte_cmdline/cmdline_vt100.c +++ b/lib/librte_cmdline/cmdline_vt100.c @@ -95,6 +95,7 @@ const char *cmdline_vt100_commands[] = { "\020", "\016", "\033\144", + vt100_bs, }; void diff --git a/lib/librte_cmdline/cmdline_vt100.h b/lib/librte_cmdline/cmdline_vt100.h index 963add8df9..b94b24e8ce 100644 --- a/lib/librte_cmdline/cmdline_vt100.h +++ b/lib/librte_cmdline/cmdline_vt100.h @@ -117,6 +117,7 @@ extern "C" { #define CMDLINE_KEY_CTRL_P 23 #define CMDLINE_KEY_CTRL_N 24 #define CMDLINE_KEY_META_D 25 +#define CMDLINE_KEY_BKSPACE2 26 extern const char *cmdline_vt100_commands[];