summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Clements <[email protected]>2009-09-30 22:32:50 -0400
committerAustin Clements <[email protected]>2009-09-30 22:32:50 -0400
commit29d8c2eebbce0274a50558bffc94099083a2cb16 (patch)
treecd8181cbdeb5e7237c8b78abf4f2326a720f93d4
parentbab819ed8d77abe65ea16945f42e76b3d4d1ff8b (diff)
downloadxv6-labs-29d8c2eebbce0274a50558bffc94099083a2cb16.tar.gz
xv6-labs-29d8c2eebbce0274a50558bffc94099083a2cb16.tar.bz2
xv6-labs-29d8c2eebbce0274a50558bffc94099083a2cb16.zip
Handle backspace on serial input and output better. Better solutions are welcome.
-rw-r--r--console.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/console.c b/console.c
index f7a6590..16d0e7a 100644
--- a/console.c
+++ b/console.c
@@ -163,7 +163,12 @@ consputc(int c)
;
}
- uartputc(c);
+ if (c == BACKSPACE) {
+ uartputc('\b');
+ uartputc(' ');
+ uartputc('\b');
+ } else
+ uartputc(c);
cgaputc(c);
}
@@ -198,6 +203,7 @@ consoleintr(int (*getc)(void))
}
break;
case C('H'): // Backspace
+ case '\x7f':
if(input.e != input.w){
input.e--;
consputc(BACKSPACE);