cmdline: support backspace key
authorXueming Li <xuemingl@mellanox.com>
Thu, 7 Dec 2017 14:52:02 +0000 (22:52 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 15 Jan 2018 11:04:57 +0000 (12:04 +0100)
Support windows putty "\b"(Ctrl-H) backspace key.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_cmdline/cmdline_rdline.c
lib/librte_cmdline/cmdline_vt100.c
lib/librte_cmdline/cmdline_vt100.h

index 1ef2258..a1aa88c 100644 (file)
@@ -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);
index a253e8b..c7b8e60 100644 (file)
@@ -95,6 +95,7 @@ const char *cmdline_vt100_commands[] = {
        "\020",
        "\016",
        "\033\144",
+       vt100_bs,
 };
 
 void
index 963add8..b94b24e 100644 (file)
@@ -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[];