diff mbox

[dpdk-dev,v1] lib/cmdline: support backspace key

Message ID 20171207145202.162545-1-xuemingl@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Xueming Li Dec. 7, 2017, 2:52 p.m. UTC
Support windows putty "\b"(Ctrl-H) backspace key.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 lib/librte_cmdline/cmdline_rdline.c | 1 +
 lib/librte_cmdline/cmdline_vt100.c  | 1 +
 lib/librte_cmdline/cmdline_vt100.h  | 1 +
 3 files changed, 3 insertions(+)

Comments

Olivier Matz Dec. 7, 2017, 3:34 p.m. UTC | #1
On Thu, Dec 07, 2017 at 10:52:02PM +0800, Xueming Li wrote:
> Support windows putty "\b"(Ctrl-H) backspace key.
> 
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>

Acked-by: Olivier Matz <olivier.matz@6wind.com>
Thomas Monjalon Jan. 15, 2018, 11:05 a.m. UTC | #2
07/12/2017 16:34, Olivier MATZ:
> On Thu, Dec 07, 2017 at 10:52:02PM +0800, Xueming Li wrote:
> > Support windows putty "\b"(Ctrl-H) backspace key.
> > 
> > Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks
diff mbox

Patch

diff --git a/lib/librte_cmdline/cmdline_rdline.c b/lib/librte_cmdline/cmdline_rdline.c
index 1ef2258d0..a1aa88c96 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 a253e8b6c..c7b8e60bd 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 963add8df..b94b24e8c 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[];