ALPHA 3.0.0 - Added Inter-Process Communication and fixed the bug where the shell would continue taking in input when a command was still running.

This commit is contained in:
WahPlus
2025-08-21 21:03:17 +03:00
parent 5276d2437b
commit ef0ffa1886
10 changed files with 208 additions and 73 deletions
+15 -5
View File
@@ -17,11 +17,21 @@ _G.shell.aliases = shellcfg["aliases"]
local function runAsTask(path, ...)
--ocelot.log("running " .. path .. " as coroutine")
tsched.runAsTask(path, ...)
local corIndex = #tsched.getTasks()
local task = tsched.getTasks()[#tsched.getTasks()]
repeat
coroutine.yield()
until tsched.getTasks()[corIndex] ~= task
local pid = tsched.getTasks()[#tsched.getTasks()].id
while true do
local foundTask = false
for _, task in pairs(tsched.getTasks()) do
if task.id == pid then
foundTask = true
break
end
end
if foundTask then
coroutine.yield()
else
break
end
end
end
function _G.shell.run(command)