cmdline (merge-intel): support ctrl-w in librte_cmdline
authorOlivier Matz <zer0@droids-corp.org>
Fri, 24 Dec 2010 12:55:33 +0000 (13:55 +0100)
committerOlivier Matz <zer0@droids-corp.org>
Sun, 2 Jan 2011 20:53:15 +0000 (21:53 +0100)
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
src/lib/cmdline_rdline.c
src/lib/cmdline_vt100.c
src/lib/cmdline_vt100.h

index 38b0773..91217be 100644 (file)
@@ -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);
index 2480974..f6b38e4 100644 (file)
@@ -92,6 +92,7 @@ const char *cmdline_vt100_commands[] = {
        vt100_word_left,
        vt100_word_right,
        "?",
+       "\027",
 };
 
 void
index 612d12b..74090b5 100644 (file)
@@ -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
 #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[];