mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Support backspace in interactive shell
This commit is contained in:
1 parent
ec3ace527b
commit
03d431ecac
1 file changed
+3
@@ -110,6 +110,9 @@ term.on("data", (data) => {
|
||||
}
|
||||
term.write(prompt);
|
||||
input = "";
|
||||
} else if (code == 127) {
|
||||
term.write("\b \b");
|
||||
input = input.slice(0, -1);
|
||||
} else if (code < 32 || code == 127) { // Control
|
||||
return;
|
||||
} else { // Visible
|
||||
|
||||
Reference in new issue
Block a user