From 3487f1f7b0823cd9a53da11f719442d54e86e9f6 Mon Sep 17 00:00:00 2001 From: MeexReay Date: Fri, 21 Mar 2025 20:06:44 +0300 Subject: [PATCH] trim terminal fix --- app/kfc/kfc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/kfc/kfc.js b/app/kfc/kfc.js index ccb6ea8..1fa6af0 100644 --- a/app/kfc/kfc.js +++ b/app/kfc/kfc.js @@ -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) { - trimTerminal(getTerminal().length - screen_length) + trimTerminal(screen_length) let screen = await cropToScreen(content, 0, 0, width, height - 1) await writeStdout(screen) 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") { if (mode == "normal") { if (event.char == ":") { - trimTerminal(getTerminal().length - status_length) + trimTerminal(status_length) writeStdout(":") let command = readLine()