Files
Halyde/halyde/core/boot.lua
T
Ponali e9cf9789b7 0.5.0 - ANSI color escape code support
I got asked to do the ANSI escape codes for color because Wahlolly couldn't find a way to get them to work. This involved making some kind of TTY, and let me be clear, i didn't know it would be so tedious to develop one. This implementation has support for dark and bright colors by using a color palette. There isn't 8-bit and 24-bit color yet, nor is there a shell parser, so please wait a bit more when it gets implemented.
2025-04-19 16:09:27 +02:00

32 lines
938 B
Lua

local loadfile = ...
local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile)
_G._OSVERSION = "Halyde 0.5.0"
function _G.import(module, ...)
local args = table.pack(...)
local modulepath
if module:find("^/") then
if filesystem.exists(module) then
modulepath = module
end
elseif filesystem.exists("/halyde/lib/"..module..".lua") then
modulepath = "/halyde/lib/"..module..".lua"
end
assert(modulepath, "module not found\npossible locations:\n/halyde/lib/"..module..".lua")
local handle = filesystem.open(modulepath)
local data = ""
local tmpdata = ""
repeat
tmpdata = handle:read(math.huge or math.maxinteger)
data = data .. (tmpdata or "")
until not tmpdata
return(assert(load(data, "="..modulepath))(table.unpack(args)))
end
--local handle = assert(filesystem.open("/bazinga.txt", "w"))
--assert(handle:write("Bazinga!"))
--handle:close()
import("/halyde/core/cormgr.lua")