Skip to content

Commit 13e1c3c

Browse files
qianfan-Zhaonashif
authored andcommitted
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 <[email protected]>
1 parent 33e3ae7 commit 13e1c3c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/console/uart_console.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ static struct k_fifo *lines_queue;
137137
static u8_t (*completion_cb)(char *line, u8_t len);
138138

139139
/* Control characters */
140+
#define BS 0x08
140141
#define ESC 0x1b
141142
#define DEL 0x7f
142143

@@ -516,6 +517,7 @@ void uart_console_isr(struct device *unused)
516517
/* Handle special control characters */
517518
if (!isprint(byte)) {
518519
switch (byte) {
520+
case BS:
519521
case DEL:
520522
if (cur > 0) {
521523
del_char(&cmd->line[--cur], end);

0 commit comments

Comments
 (0)