mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Console: Handle ^H as backspace
Currently only ASCII DEL (key code 127) is handled as backspace, but some terminal emulators are sending ^H which is ASCII BS (key code 8). Looks like we can safely treat both in the same matter.
This commit is contained in:
+1
-1
@@ -169,7 +169,7 @@ void cmd_edit(void) __banked
|
|||||||
} else { // An unknown or not yet complete Escape sequence: wait
|
} else { // An unknown or not yet complete Escape sequence: wait
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (sbuf[l] == 127) { // Backspace
|
} else if (sbuf[l] == 127 || sbuf[l] == 8) { // Backspace DEL or BS/^H
|
||||||
if (cursor > 0) {
|
if (cursor > 0) {
|
||||||
write_char('\010');
|
write_char('\010');
|
||||||
for (uint8_t i = cursor; i < cmd_line_len; i++)
|
for (uint8_t i = cursor; i < cmd_line_len; i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user