From 67c418f5976af91713b29fbae0a9b9cd2300d0ce Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Sun, 2 Jun 2024 02:35:00 +0200 Subject: [PATCH] Fix test.lua always clearing terminal in display --- requests.lua | 1 + test.lua | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/requests.lua b/requests.lua index ad2dd0a..3e5ea3c 100644 --- a/requests.lua +++ b/requests.lua @@ -57,6 +57,7 @@ local function fetch(wait_for) end local function drawLine(termlike, obj) + termlike.setBackgroundColor(colors.black) termlike.setTextColor(colors.white) termlike.write(obj.req.name) termlike.write(" ") diff --git a/test.lua b/test.lua index bcd6efd..0829523 100644 --- a/test.lua +++ b/test.lua @@ -14,10 +14,6 @@ local tabview_window = nil local function display() local tw,th = term.getSize() - term.setCursorBlink(false) - term.setBackgroundColor(colors.black) - term.clear() - term.setCursorPos(1,1) term.setBackgroundColor(colors.yellow) term.setTextColor(colors.black) @@ -31,7 +27,11 @@ local function display() term.write(" R ") end term.write(" ^ v ") + term.setBackgroundColor(colors.black) + term.setTextColor(colors.white) + term.setCursorPos(1,2) + term.clearLine() for name, tab in pairs(tabview.allTabs()) do tab.displayTab(tab) @@ -107,6 +107,13 @@ local function init() term.redirect(monitor) end + term.setCursorBlink(false) + term.setBackgroundColor(colors.black) + term.setTextColor(colors.white) + term.clear() + term.setCursorPos(1,2) + term.write("Booting test.lua") + local tw, th = term.getSize() tabview_window = window.create(term.current(), 1, 1+header_lines, tw, th-header_lines) tabview.setTerm(tabview_window)