local hpv=require("hypervisor")
local term=component.getFirst("screen")

term.clear()
local function m(str, m)
    if #str>m then
        return str:sub(1,m-1).."- "
    else
        while #str~=m do
            str=str.." "
        end
        return str.." "
    end
end

for i in hpv.listProc() do
    term.print(m(i.name, 15)..m(i.status, 7)..m(i.pid, 4))
    for _,v in ipairs(i.threads) do
        if v.name~="main" then
            term.print("   "..m(v.name, 12)..m(v.status, 7))
        end
    end
end