diff options
author | Richard Braun <rbraun@sceen.net> | 2016-12-09 03:11:56 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2016-12-09 03:11:56 +0100 |
commit | b5d93168c2996d314a8cc79cd6939c34f1ac7fe7 (patch) | |
tree | 58d0935c56816716a62c99e8275cabfcf5f1ced8 /shell.c | |
parent | 5b0ec6b075662d24fb72acf394335731fd9db5ba (diff) |
shell: handle multiple backspace control characters
Diffstat (limited to 'shell.c')
-rw-r--r-- | shell.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -137,12 +137,13 @@ static unsigned long shell_cursor; #define SHELL_SEPARATOR ' ' -#if 0 -#define SHELL_ERASE '\b' -#define SHELL_ERASE '\x7f' -#endif - -#define SHELL_ERASE '\x7f' +/* + * Commonly used backspace control characters. + * + * XXX Adjust for your needs. + */ +#define SHELL_ERASE_BS '\b' +#define SHELL_ERASE_DEL '\x7f' /* * Buffer used to store the current line during argument processing. @@ -1074,7 +1075,8 @@ static int shell_process_ctrl_char(char c) { switch (c) { - case SHELL_ERASE: + case SHELL_ERASE_BS: + case SHELL_ERASE_DEL: shell_process_backspace(); break; case '\t': |