From: Olivier Matz Date: Fri, 24 Dec 2010 12:55:33 +0000 (+0100) Subject: cmdline (merge-intel): support ctrl-w in librte_cmdline X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=12df0462d324d6aaced9491955628c46b9ea853c;p=libcmdline.git cmdline (merge-intel): support ctrl-w in librte_cmdline Signed-off-by: Olivier Matz --- diff --git a/src/lib/cmdline_rdline.c b/src/lib/cmdline_rdline.c index 38b0773..91217be 100644 --- a/src/lib/cmdline_rdline.c +++ b/src/lib/cmdline_rdline.c @@ -279,6 +279,7 @@ rdline_char_in(struct rdline *rdl, char c) break; case CMDLINE_KEY_META_BKSPACE: + case CMDLINE_KEY_CTRL_W: while (! CIRBUF_IS_EMPTY(&rdl->left) && isblank2(cirbuf_get_tail(&rdl->left))) { rdline_puts(rdl, vt100_bs); cirbuf_del_tail(&rdl->left); diff --git a/src/lib/cmdline_vt100.c b/src/lib/cmdline_vt100.c index 2480974..f6b38e4 100644 --- a/src/lib/cmdline_vt100.c +++ b/src/lib/cmdline_vt100.c @@ -92,6 +92,7 @@ const char *cmdline_vt100_commands[] = { vt100_word_left, vt100_word_right, "?", + "\027", }; void diff --git a/src/lib/cmdline_vt100.h b/src/lib/cmdline_vt100.h index 612d12b..74090b5 100644 --- a/src/lib/cmdline_vt100.h +++ b/src/lib/cmdline_vt100.h @@ -84,7 +84,6 @@ #define vt100_word_left "\033\142" #define vt100_word_right "\033\146" - /* Result of parsing : it must be synchronized with * cmdline_vt100_commands[] in vt100.c */ #define CMDLINE_KEY_UP_ARR 0 @@ -109,6 +108,7 @@ #define CMDLINE_KEY_WLEFT 19 #define CMDLINE_KEY_WRIGHT 20 #define CMDLINE_KEY_HELP 21 +#define CMDLINE_KEY_CTRL_W 22 extern const char *cmdline_vt100_commands[];