Handle backspace on serial input and output better. Better solutions are welcome.

This commit is contained in:
Austin Clements 2009-09-30 22:32:50 -04:00
parent bab819ed8d
commit 29d8c2eebb

View file

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