* [dpdk-dev] [PATCH] lib/cmdline: support backspace key
@ 2017-11-15 15:51 Xueming Li
2017-12-07 14:28 ` Olivier MATZ
2017-12-07 14:52 ` [dpdk-dev] [PATCH v1] " Xueming Li
0 siblings, 2 replies; 5+ messages in thread
From: Xueming Li @ 2017-11-15 15:51 UTC (permalink / raw)
To: Olivier Matz; +Cc: Xueming Li, dev
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..167657f4b 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_BKSPACE1:
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..bb317507e 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",
+ "\b",
};
void
diff --git a/lib/librte_cmdline/cmdline_vt100.h b/lib/librte_cmdline/cmdline_vt100.h
index 963add8df..c803734fa 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_BKSPACE1 26
extern const char *cmdline_vt100_commands[];
--
2.13.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] lib/cmdline: support backspace key
2017-11-15 15:51 [dpdk-dev] [PATCH] lib/cmdline: support backspace key Xueming Li
@ 2017-12-07 14:28 ` Olivier MATZ
2017-12-07 14:52 ` [dpdk-dev] [PATCH v1] " Xueming Li
1 sibling, 0 replies; 5+ messages in thread
From: Olivier MATZ @ 2017-12-07 14:28 UTC (permalink / raw)
To: Xueming Li; +Cc: dev
Hi Xueming,
On Wed, Nov 15, 2017 at 11:51:56PM +0800, Xueming Li wrote:
> 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..167657f4b 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_BKSPACE1:
> if(!cirbuf_del_tail_safe(&rdl->left)) {
> rdline_puts(rdl, vt100_bs);
> display_right_buffer(rdl, 1);
I would have used CMDLINE_KEY_BKSPACE2 instead of CMDLINE_KEY_BKSPACE1 :)
> diff --git a/lib/librte_cmdline/cmdline_vt100.c b/lib/librte_cmdline/cmdline_vt100.c
> index a253e8b6c..bb317507e 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",
> + "\b",
> };
>
> void
You can reuse vt100_bs instead of '\b', which is defined in
cmdline_vt100.h (note that '\010' == '\b')
Thanks
Olivier
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v1] lib/cmdline: support backspace key
2017-11-15 15:51 [dpdk-dev] [PATCH] lib/cmdline: support backspace key Xueming Li
2017-12-07 14:28 ` Olivier MATZ
@ 2017-12-07 14:52 ` Xueming Li
2017-12-07 15:34 ` Olivier MATZ
1 sibling, 1 reply; 5+ messages in thread
From: Xueming Li @ 2017-12-07 14:52 UTC (permalink / raw)
To: Olivier MATZ; +Cc: Xueming Li, dev
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v1] lib/cmdline: support backspace key
2017-12-07 14:52 ` [dpdk-dev] [PATCH v1] " Xueming Li
@ 2017-12-07 15:34 ` Olivier MATZ
2018-01-15 11:05 ` Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Olivier MATZ @ 2017-12-07 15:34 UTC (permalink / raw)
To: Xueming Li; +Cc: dev
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>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v1] lib/cmdline: support backspace key
2017-12-07 15:34 ` Olivier MATZ
@ 2018-01-15 11:05 ` Thomas Monjalon
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2018-01-15 11:05 UTC (permalink / raw)
To: Xueming Li; +Cc: dev, Olivier MATZ
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-01-15 11:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-15 15:51 [dpdk-dev] [PATCH] lib/cmdline: support backspace key Xueming Li
2017-12-07 14:28 ` Olivier MATZ
2017-12-07 14:52 ` [dpdk-dev] [PATCH v1] " Xueming Li
2017-12-07 15:34 ` Olivier MATZ
2018-01-15 11:05 ` Thomas Monjalon
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).