fix read line

This commit is contained in:
MeexReay 2025-03-21 23:38:20 +03:00
parent ee80265097
commit 298b4a07bc

View File

@ -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()