From 153fb897ca7eca66b891d38cf954d22b39dda0d7 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 3 Jun 2012 10:25:37 -0700 Subject: [PATCH] console: Support delete as well as backspace Some terminals do not generate backspace correctly, so accept delete as a substitute. BUG=chrome-os-partner:10147 TEST=manual: ssh into workstation, then telnet to serial port (with ser2net running) See that the backspace key now works correctly, instead of injecting strange characters into the terminal. Change-Id: Ief6f2bcab9b8e82cb5720d18c596326b49ffc336 Signed-off-by: Simon Glass Reviewed-on: https://gerrit.chromium.org/gerrit/24715 Reviewed-by: Randall Spangler --- common/uart_buffering.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/uart_buffering.c b/common/uart_buffering.c index 9a0fd715ed..5743351412 100644 --- a/common/uart_buffering.c +++ b/common/uart_buffering.c @@ -339,10 +339,10 @@ void uart_process(void) * don't interfere with the transmit buffer. */ if (c == '\n') uart_write_char('\r'); - uart_write_char(c); + uart_write_char(c == 0x7f ? '\b' : c); /* Handle backspace if we can */ - if (c == '\b') { + if (c == '\b' || c == 0x7f) { handle_backspace(); continue; }