Fix test.lua always clearing terminal in display

This commit is contained in:
Ben 2024-06-02 02:35:00 +02:00
parent 20a4488a64
commit 67c418f597
Signed by: ben
GPG key ID: 0F54A7ED232D3319
2 changed files with 12 additions and 4 deletions

View file

@ -57,6 +57,7 @@ local function fetch(wait_for)
end end
local function drawLine(termlike, obj) local function drawLine(termlike, obj)
termlike.setBackgroundColor(colors.black)
termlike.setTextColor(colors.white) termlike.setTextColor(colors.white)
termlike.write(obj.req.name) termlike.write(obj.req.name)
termlike.write(" ") termlike.write(" ")

View file

@ -14,10 +14,6 @@ local tabview_window = nil
local function display() local function display()
local tw,th = term.getSize() local tw,th = term.getSize()
term.setCursorBlink(false)
term.setBackgroundColor(colors.black)
term.clear()
term.setCursorPos(1,1) term.setCursorPos(1,1)
term.setBackgroundColor(colors.yellow) term.setBackgroundColor(colors.yellow)
term.setTextColor(colors.black) term.setTextColor(colors.black)
@ -31,7 +27,11 @@ local function display()
term.write(" R ") term.write(" R ")
end end
term.write(" ^ v ") term.write(" ^ v ")
term.setBackgroundColor(colors.black) term.setBackgroundColor(colors.black)
term.setTextColor(colors.white)
term.setCursorPos(1,2)
term.clearLine()
for name, tab in pairs(tabview.allTabs()) do for name, tab in pairs(tabview.allTabs()) do
tab.displayTab(tab) tab.displayTab(tab)
@ -107,6 +107,13 @@ local function init()
term.redirect(monitor) term.redirect(monitor)
end 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() local tw, th = term.getSize()
tabview_window = window.create(term.current(), 1, 1+header_lines, tw, th-header_lines) tabview_window = window.create(term.current(), 1, 1+header_lines, tw, th-header_lines)
tabview.setTerm(tabview_window) tabview.setTerm(tabview_window)