cmdline: support backspace key

Support windows putty "\b"(Ctrl-H) backspace key.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
This commit is contained in:
Xueming Li 2017-12-07 22:52:02 +08:00 committed by Thomas Monjalon
parent aac6f11f58
commit c89dc62533
3 changed files with 3 additions and 0 deletions

View File

@ -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);

View File

@ -95,6 +95,7 @@ const char *cmdline_vt100_commands[] = {
"\020",
"\016",
"\033\144",
vt100_bs,
};
void

View File

@ -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[];