Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
function createProc(dir)
proc = {}
proc.name = fs.getName(dir)
proc.coroutine = coroutine.create(function () shell.run(dir) end)
return proc
end
function runProc(proc)
local function terminateProc(proc)
proc = nil
term.redirect(term.native())
nWindow.setVisible(false)
nWindow = nil
end
x,y = term.getSize()
nWindow = window.create(term.native(),1,2,x,y-1,true)
term.redirect(nWindow)
check, _sFilter, arg1 = coroutine.resume(proc.coroutine)
while true do
if coroutine.status(proc.coroutine) == "dead" then
if not check then term.setBackgroundColor(colors.black) print(_sFilter) sleep(1.2) end
terminateProc(proc)
break
end
local eventData = { os.pullEventRaw( _sFilter ) }
if eventData[1] == "terminate" then
terminateProc(proc)
break
end
--if eventData[1] == "mouse_click" then if eventData[4] == 1 then terminateProc(proc) break end end
check, _sFilter, arg1 = coroutine.resume(proc.coroutine, unpack(eventData))
end
terminated = false
return nil
end