Handle backspace on serial input and output better. Better solutions are welcome.
This commit is contained in:
parent
bab819ed8d
commit
29d8c2eebb
1 changed files with 7 additions and 1 deletions
|
@ -163,6 +163,11 @@ consputc(int 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);
|
||||
|
|
Loading…
Reference in a new issue