DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier MATZ <olivier.matz@6wind.com>
To: Xueming Li <xuemingl@mellanox.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] lib/cmdline: support backspace key
Date: Thu, 7 Dec 2017 15:28:25 +0100	[thread overview]
Message-ID: <20171207142824.r5kezdwezj6ke5xt@glumotte.dev.6wind.com> (raw)
In-Reply-To: <20171115155156.9566-1-xuemingl@mellanox.com>

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

  reply	other threads:[~2017-12-07 14:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 15:51 Xueming Li
2017-12-07 14:28 ` Olivier MATZ [this message]
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

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=20171207142824.r5kezdwezj6ke5xt@glumotte.dev.6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    --cc=xuemingl@mellanox.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).