backspace cursor fix asdasdasdasd

This commit is contained in:
MeexReay 2025-03-21 18:30:44 +03:00
parent d73fe415b1
commit 5d29953930

View File

@ -28,7 +28,7 @@ async function readLine(on_key=(key, ctrl, alt, shift, content, pos) => [content
if (event.type == "key") { if (event.type == "key") {
if (event.key == "Backspace") { if (event.key == "Backspace") {
if (pos > 1) { if (pos >= 1) {
content = content.slice(0, pos - 1) + content.slice(pos) content = content.slice(0, pos - 1) + content.slice(pos)
pos -= 1 pos -= 1
setTerminal(start_terminal.substring(0, terminal_text.length-length) + content) setTerminal(start_terminal.substring(0, terminal_text.length-length) + content)