From: Xueming Li <xuemingl@mellanox.com>
To: Olivier MATZ <olivier.matz@6wind.com>
Cc: Xueming Li <xuemingl@mellanox.com>, dev@dpdk.org
Subject: [dpdk-dev] [PATCH v1] lib/cmdline: support backspace key
Date: Thu, 7 Dec 2017 22:52:02 +0800 [thread overview]
Message-ID: <20171207145202.162545-1-xuemingl@mellanox.com> (raw)
In-Reply-To: <20171115155156.9566-1-xuemingl@mellanox.com>
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(+)
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[];
--
2.13.3
next prev parent reply other threads:[~2017-12-07 14:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-15 15:51 [dpdk-dev] [PATCH] " Xueming Li
2017-12-07 14:28 ` Olivier MATZ
2017-12-07 14:52 ` Xueming Li [this message]
2017-12-07 15:34 ` [dpdk-dev] [PATCH v1] " Olivier MATZ
2018-01-15 11:05 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171207145202.162545-1-xuemingl@mellanox.com \
--to=xuemingl@mellanox.com \
--cc=dev@dpdk.org \
--cc=olivier.matz@6wind.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).