From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 8B2C31B1B7 for ; Wed, 15 Nov 2017 16:52:05 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@mellanox.com) with ESMTPS (AES256-SHA encrypted); 15 Nov 2017 17:52:04 +0200 Received: from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx [10.12.205.180]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id vAFFq3fX022102; Wed, 15 Nov 2017 17:52:04 +0200 Received: from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1]) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id vAFFq3uJ009612; Wed, 15 Nov 2017 23:52:03 +0800 Received: (from xuemingl@localhost) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id vAFFq3a6009611; Wed, 15 Nov 2017 23:52:03 +0800 From: Xueming Li To: Olivier Matz Cc: Xueming Li , dev@dpdk.org Date: Wed, 15 Nov 2017 23:51:56 +0800 Message-Id: <20171115155156.9566-1-xuemingl@mellanox.com> X-Mailer: git-send-email 2.13.3 Subject: [dpdk-dev] [PATCH] lib/cmdline: support backspace key X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Nov 2017 15:52:05 -0000 Support windows putty "\b"(Ctrl-H) backspace key. Signed-off-by: Xueming Li --- 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