1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-20 18:27:40 +00:00

better startup

This commit is contained in:
kepler155c@gmail.com
2017-09-26 15:18:44 -04:00
parent f2e1a39584
commit 13efde276d
5 changed files with 22 additions and 2131 deletions

View File

@@ -13,7 +13,7 @@ local env = {
aliases = shell.aliases(),
lua_path = LUA_PATH,
}
Config.load('multishell', env)
Config.load('shell', env)
UI.TextEntry.defaults.backgroundFocusColor = colors.black
@@ -126,7 +126,7 @@ function systemPage.tabs.pathTab:eventHandler(event)
env.path = self.entry.value
self.grid:setIndex(self.grid:getIndex())
self.grid:draw()
Config.update('multishell', env)
Config.update('shell', env)
systemPage.notification:success('reboot to take effect')
return true
end
@@ -148,7 +148,7 @@ function systemPage.tabs.aliasTab:eventHandler(event)
env.aliases[self.grid:getSelected().alias] = nil
self.grid:setIndex(self.grid:getIndex())
self.grid:draw()
Config.update('multishell', env)
Config.update('shell', env)
systemPage.notification:success('reboot to take effect')
return true
@@ -158,7 +158,7 @@ function systemPage.tabs.aliasTab:eventHandler(event)
self.path:reset()
self:draw()
self:setFocus(self.alias)
Config.update('multishell', env)
Config.update('shell', env)
systemPage.notification:success('reboot to take effect')
return true
end

View File

@@ -61,14 +61,12 @@ function shell.run(...)
local result, err
local env = Util.shallowCopy(sandboxEnv)
if isUrl then
local env = Util.shallowCopy(sandboxEnv)
setmetatable(env, { __index = _G })
result, err = Util.runUrl(env, path, unpack(args))
else
result, err = os.run(Util.shallowCopy(sandboxEnv), path, unpack(args))
result, err = Util.run(env, path, unpack(args))
end
if multishell and multishell.getTitle then
local title = 'shell'
if #tProgramStack > 0 then
@@ -237,7 +235,7 @@ if #tArgs > 0 then
-- Run the program specified in this new shell
local s, m = shell.run( ... )
if not s and m and m ~= 'Terminated' then
error(m or '')
error(m)
end
return s, m
end