uart_console: delete char using BS(08H) or DEL(7FH)
Some serial tools such as 'minicom' send BS when press backspace, not DEL, so delete char using BS or DEL. Fixes: #7959 Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
This commit is contained in:
parent
33e3ae711e
commit
13e1c3c2f8
1 changed files with 2 additions and 0 deletions
|
@ -137,6 +137,7 @@ static struct k_fifo *lines_queue;
|
|||
static u8_t (*completion_cb)(char *line, u8_t len);
|
||||
|
||||
/* Control characters */
|
||||
#define BS 0x08
|
||||
#define ESC 0x1b
|
||||
#define DEL 0x7f
|
||||
|
||||
|
@ -516,6 +517,7 @@ void uart_console_isr(struct device *unused)
|
|||
/* Handle special control characters */
|
||||
if (!isprint(byte)) {
|
||||
switch (byte) {
|
||||
case BS:
|
||||
case DEL:
|
||||
if (cur > 0) {
|
||||
del_char(&cmd->line[--cur], end);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue