1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-15 15:57:40 +00:00

better startup

This commit is contained in:
kepler155c@gmail.com
2017-09-25 17:00:02 -04:00
parent 3c2892074a
commit f325550de2
5 changed files with 64 additions and 38 deletions

View File

@@ -1,11 +1,13 @@
local parentShell = shell
shell = { }
local sandboxEnv = { }
local shell = { }
local sandboxEnv = setmetatable({ }, { __index = _G })
for k,v in pairs(getfenv(1)) do
sandboxEnv[k] = v
end
setmetatable(sandboxEnv, { __index = _G })
sandboxEnv.shell = shell
sandboxEnv.multishell = multishell or { }
requireInjector(getfenv(1))
@@ -66,7 +68,7 @@ function shell.run(...)
result, err = os.run(Util.shallowCopy(sandboxEnv), path, unpack(args))
end
if multishell then
if multishell and multishell.getTitle then
local title = 'shell'
if #tProgramStack > 0 then
title = fs.getName(tProgramStack[#tProgramStack])