mirror of
https://github.com/MeexReay/poshlostios.git
synced 2025-06-24 10:32:59 +03:00
fix readline
This commit is contained in:
parent
2ac47b73b8
commit
e47b488ae6
@ -23,7 +23,7 @@ async function readLine(on_key=(key, ctrl, alt, shift, content, pos) => [content
|
||||
while (true) {
|
||||
let event = await pollStdinEvent()
|
||||
|
||||
console.log(event)
|
||||
console.log(event)
|
||||
|
||||
if (event.type == "key") {
|
||||
if (event.key == "Backspace") {
|
||||
@ -44,7 +44,7 @@ async function readLine(on_key=(key, ctrl, alt, shift, content, pos) => [content
|
||||
pos += 1
|
||||
}
|
||||
} else {
|
||||
let res = on_key(key, is_ctrl, is_alt, is_shift, content, pos)
|
||||
let res = on_key(event.key, is_ctrl, is_alt, is_shift, content, pos)
|
||||
terminal_text = terminal_text.slice(0, terminal_text.length - content.length) + res[0]
|
||||
updateTerminal()
|
||||
setCursor(start_cursor_pos[0] + res[1], start_cursor_pos[1])
|
||||
|
Loading…
x
Reference in New Issue
Block a user