mirror of
https://github.com/MeexReay/poshlostios.git
synced 2025-06-24 18:42:59 +03:00
trim terminal fix
This commit is contained in:
parent
60e7a7945d
commit
3487f1f7b0
@ -18,7 +18,7 @@ async function cropToScreen(text, x, y, width, height) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function printScreen(screen_length, start_cursor, pos, content, mode, pos, x, y, width, height) {
|
async function printScreen(screen_length, start_cursor, pos, content, mode, pos, x, y, width, height) {
|
||||||
trimTerminal(getTerminal().length - screen_length)
|
trimTerminal(screen_length)
|
||||||
let screen = await cropToScreen(content, 0, 0, width, height - 1)
|
let screen = await cropToScreen(content, 0, 0, width, height - 1)
|
||||||
await writeStdout(screen)
|
await writeStdout(screen)
|
||||||
let status_line = `\nmode: ${mode} | size: ${content.length} | lines: ${content.split("\n").length} | x: ${pos[0]} | y: ${pos[1]}`
|
let status_line = `\nmode: ${mode} | size: ${content.length} | lines: ${content.split("\n").length} | x: ${pos[0]} | y: ${pos[1]}`
|
||||||
@ -73,7 +73,7 @@ async function main(args) {
|
|||||||
} else if (event.type == "char") {
|
} else if (event.type == "char") {
|
||||||
if (mode == "normal") {
|
if (mode == "normal") {
|
||||||
if (event.char == ":") {
|
if (event.char == ":") {
|
||||||
trimTerminal(getTerminal().length - status_length)
|
trimTerminal(status_length)
|
||||||
writeStdout(":")
|
writeStdout(":")
|
||||||
|
|
||||||
let command = readLine()
|
let command = readLine()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user