summaryrefslogtreecommitdiff
path: root/shell.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2016-12-09 03:11:56 +0100
committerRichard Braun <rbraun@sceen.net>2016-12-09 03:11:56 +0100
commitb5d93168c2996d314a8cc79cd6939c34f1ac7fe7 (patch)
tree58d0935c56816716a62c99e8275cabfcf5f1ced8 /shell.c
parent5b0ec6b075662d24fb72acf394335731fd9db5ba (diff)
shell: handle multiple backspace control characters
Diffstat (limited to 'shell.c')
-rw-r--r--shell.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/shell.c b/shell.c
index 27cf5fe..9040824 100644
--- a/shell.c
+++ b/shell.c
@@ -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':