mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-23 21:10:19 +00:00
Merge branch 'main' into dev
This commit is contained in:
commit
91f38518ff
@ -9,7 +9,7 @@
|
||||
<a title="Pub" href="https://pub.dev/packages/pocketpy" ><img src="https://img.shields.io/pub/v/pocketpy" /></a>
|
||||
</p>
|
||||
|
||||
PocketPy is a lightweight(~6000 LOC) Python interpreter for game engines.
|
||||
PocketPy is a lightweight(~6000 LOC) Python interpreter for game engines/apps.
|
||||
|
||||
|
||||
**English |** [**简体中文**](README_zh.md)
|
||||
|
15
web/index.js
15
web/index.js
@ -143,13 +143,14 @@ function term_init() {
|
||||
term.write(need_more_lines ? "... " : ">>> ");
|
||||
break;
|
||||
case '\u007F': // Backspace (DEL)
|
||||
// Do not delete the prompt
|
||||
if (term._core.buffer.x > 4) { // '>>> ' or '... '
|
||||
term.write('\b \b');
|
||||
if (command.length > 0) {
|
||||
command = command.substr(0, command.length - 1);
|
||||
}
|
||||
}
|
||||
var cnt = term._core.buffer.x-4;
|
||||
if(cnt<=0 || command.length==0) break;
|
||||
// delete the last unicode char
|
||||
command = command.replace(/.$/u, "");
|
||||
// clear the whole line
|
||||
term.write('\b \b'.repeat(cnt));
|
||||
// re-write the command
|
||||
term.write(command);
|
||||
break;
|
||||
default: // Print all other characters for demo
|
||||
if (e >= String.fromCharCode(0x20) && e <= String.fromCharCode(0x7E) || e >= '\u00a0') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user