From ff04e730f92719b1f7e8cee7db8e7d273181bfa9 Mon Sep 17 00:00:00 2001 From: Ponali Date: Sun, 14 Sep 2025 18:46:26 +0200 Subject: [PATCH] ported apps download/wget, fetch, label, and lscor/ps for the fetch app to fully work, defenv has been edited to share _OSLOGO. --- halyde/apps/download.lua | 4 ++-- halyde/apps/fetch.lua | 9 ++++++--- halyde/apps/label.lua | 4 ++-- halyde/apps/lscor.lua | 15 +++++++-------- halyde/kernel/modules/defenv.lua | 1 + 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/halyde/apps/download.lua b/halyde/apps/download.lua index 5885055..6098730 100644 --- a/halyde/apps/download.lua +++ b/halyde/apps/download.lua @@ -10,7 +10,7 @@ end if not url then print("Please enter a URL to download from.") - shell.run("help download") + require("shell").run("help download") return end @@ -39,7 +39,7 @@ until not tmpdata local saveLocation local saveLocationOK = false repeat - saveLocation = read(nil, "File save location: ", fs.concat(shell.workingDirectory, url:match("/([^/]+)$"))) + saveLocation = terminal.read(nil, "File save location: ", fs.concat(require("shell").getWorkingDirectory(), url:match("/([^/]+)$"))) if fs.isDirectory(saveLocation) then print("\27[91mThe specified location is a directory.") elseif fs.exists(saveLocation) then diff --git a/halyde/apps/fetch.lua b/halyde/apps/fetch.lua index eb71ae2..ef387a8 100644 --- a/halyde/apps/fetch.lua +++ b/halyde/apps/fetch.lua @@ -2,12 +2,14 @@ local component = require("component") local computer = require("computer") local function printstat(text) - terminal.cursorPosX = 35 + local cursorPosX, cursorPosY = terminal.getCursorPos() + terminal.setCursorPos(35, cursorPosY) terminal.write(text .. "\n", false) end terminal.write(_OSLOGO, false) -terminal.cursorPosY = terminal.cursorPosY - 17 +local cursorPosX, cursorPosY = terminal.getCursorPos() +terminal.setCursorPos(cursorPosX, cursorPosY - 17) printstat("\27[92mOS\27[0m: ".._OSVERSION) printstat("\27[92mArchitecture\27[0m: ".._VERSION) local componentCounter = 0 @@ -67,4 +69,5 @@ local width, height = component.invoke(component.list("gpu")(), "getResolution") printstat("\27[92mResolution\27[0m: "..tostring(width).."x"..tostring(height).."\n") printstat("\27[40m \27[41m \27[42m \27[43m \27[44m \27[45m \27[46m \27[47m ") printstat("\27[100m \27[101m \27[102m \27[103m \27[104m \27[105m \27[106m \27[107m ") -terminal.cursorPosY = terminal.cursorPosY + 5 +local cursorPosX, cursorPosY = terminal.getCursorPos() +terminal.setCursorPos(cursorPosX, cursorPosY + 5) diff --git a/halyde/apps/label.lua b/halyde/apps/label.lua index 2ed358e..ee7413f 100644 --- a/halyde/apps/label.lua +++ b/halyde/apps/label.lua @@ -3,7 +3,7 @@ local computer = require("computer") local args = {...} if not args then return print("\x1b[91mCannot get arguments.") end if not args[1] then - return shell.run("help label") + return require("shell").run("help label") end local inputID = args[1] local comp @@ -33,7 +33,7 @@ elseif #inputID>=3 then comp = component.proxy(fullID) else print("\x1b[91mAddress must have atleast 3 characters") - return shell.run("help label") + return require("shell").run("help label") end if not comp then return print("\x1b[91mCould not find component from \""..inputID.."\".") diff --git a/halyde/apps/lscor.lua b/halyde/apps/lscor.lua index ffe3495..3ef4cd9 100644 --- a/halyde/apps/lscor.lua +++ b/halyde/apps/lscor.lua @@ -1,9 +1,8 @@ -print("\27[93m"..tostring(#cormgr.corList).."\27[0m coroutines active") -for i=1, #cormgr.corList do - if i==#cormgr.corList then - print("\27[93m└ "..i.."\27[0m - "..cormgr.labelList[i].." \27[0m") - else - print("\27[93m├ "..i.."\27[0m - "..cormgr.labelList[i].." \27[0m") - end - +local tasks = tsched.getTasks() +print("\27[93m"..tostring(#tasks).."\27[0m coroutines active") +for i=1, #tasks do + local pipeChar = "├ " + if i==#tasks then pipeChar = "└ " end + local task = tasks[i] + print("\27[93m"..pipeChar..i.."\27[0m - "..task.name.."\27[37m "..table.concat(task.args or {}," ").." \27[0m") end diff --git a/halyde/kernel/modules/defenv.lua b/halyde/kernel/modules/defenv.lua index 430584c..2844562 100644 --- a/halyde/kernel/modules/defenv.lua +++ b/halyde/kernel/modules/defenv.lua @@ -11,6 +11,7 @@ function module.init() "print", "_VERSION", "_OSVERSION", + "_OSLOGO", "assert", "error", "getmetatable",