summaryrefslogtreecommitdiff
path: root/common/uart_buffering.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-06-03 10:25:37 -0700
committerGerrit <chrome-bot@google.com>2012-06-07 12:07:38 -0700
commit153fb897ca7eca66b891d38cf954d22b39dda0d7 (patch)
tree45d940a54d1f7b511540e95e50c984e5bcf8cb5f /common/uart_buffering.c
parentc8eb271d6ab48d8d40ab08e83881965f91887e34 (diff)
downloadchrome-ec-153fb897ca7eca66b891d38cf954d22b39dda0d7.tar.gz
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 <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/24715 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/uart_buffering.c')
-rw-r--r--common/uart_buffering.c4
1 files 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;
}