diff --git a/sys/system.js b/sys/system.js index b1fddcc..13ccc6f 100644 --- a/sys/system.js +++ b/sys/system.js @@ -31,14 +31,14 @@ async function readLine(on_key=(key, ctrl, alt, shift, content, pos) => [content if (pos >= 1) { content = content.slice(0, pos - 1) + content.slice(pos) pos -= 1 - setTerminal(start_terminal.substring(0, terminal_text.length-length) + content) + setTerminal(start_terminal + content) let cursor = getCursor() setCursor(cursor[0]-1, cursor[1]) updateTerminalWOCursor() } } else if (event.key == "Delete") { content = content.slice(0, pos) + content.slice(pos + 1) - setTerminal(start_terminal.substring(0, terminal_text.length-length) + content) + setTerminal(start_terminal + content) updateTerminalWOCursor() } else if (event.key == "ArrowLeft") { let cursor = getCursor()