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>
This commit is contained in:
Simon Glass
2012-06-03 10:25:37 -07:00
committed by Gerrit
parent c8eb271d6a
commit 153fb897ca

View File

@@ -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;
}