mirror of
https://github.com/kepler155c/opus
synced 2025-01-16 18:32:52 +00:00
rename shell -> shell.lua
This commit is contained in:
parent
2d411df7d1
commit
ae6d8e8ebd
2
startup
2
startup
@ -6,7 +6,7 @@ local term = _G.term
|
||||
local bootOptions = {
|
||||
{ prompt = os.version() },
|
||||
{ prompt = 'Opus' , args = { '/sys/boot/opus.boot' } },
|
||||
{ prompt = 'Opus Shell' , args = { '/sys/boot/opus.boot', 'sys/apps/shell' } },
|
||||
{ prompt = 'Opus Shell' , args = { '/sys/boot/opus.boot', 'sys/apps/shell.lua' } },
|
||||
{ prompt = 'Opus Kiosk' , args = { '/sys/boot/kiosk.boot' } },
|
||||
}
|
||||
local bootOption = 2
|
||||
|
@ -25,8 +25,8 @@ function Terminal.window(parent, sx, sy, w, h, isVisible)
|
||||
width = w,
|
||||
height = h,
|
||||
isColor = parent.isColor(),
|
||||
offy = 0,
|
||||
})
|
||||
canvas.offy = 0
|
||||
|
||||
win.canvas = canvas
|
||||
|
||||
@ -164,7 +164,7 @@ function Terminal.window(parent, sx, sy, w, h, isVisible)
|
||||
function win.redraw()
|
||||
if isVisible then
|
||||
canvas:dirty()
|
||||
canvas:render(parent)
|
||||
update()
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -198,10 +198,12 @@ function Canvas:blit(x, y, text, bg, fg)
|
||||
end
|
||||
|
||||
function Canvas:writeLine(y, text, fg, bg)
|
||||
self.lines[y].dirty = true
|
||||
self.lines[y].text = text
|
||||
self.lines[y].fg = fg
|
||||
self.lines[y].bg = bg
|
||||
if y > 0 and y <= #self.lines then
|
||||
self.lines[y].dirty = true
|
||||
self.lines[y].text = text
|
||||
self.lines[y].fg = fg
|
||||
self.lines[y].bg = bg
|
||||
end
|
||||
end
|
||||
|
||||
function Canvas:clearLine(y, bg, fg)
|
||||
|
@ -15,20 +15,12 @@ UI.Checkbox.defaults = {
|
||||
backgroundColor = colors.black,
|
||||
backgroundFocusColor = colors.lightGray,
|
||||
height = 1,
|
||||
width = 3,
|
||||
accelerators = {
|
||||
space = 'checkbox_toggle',
|
||||
mouse_click = 'checkbox_toggle',
|
||||
}
|
||||
}
|
||||
function UI.Checkbox:setParent()
|
||||
if not self.width and not self.ex then
|
||||
self.width = (self.label and #self.label or 0) + 3
|
||||
else
|
||||
self.width = 3
|
||||
end
|
||||
UI.Window.setParent(self)
|
||||
end
|
||||
|
||||
function UI.Checkbox:draw()
|
||||
local bg = self.backgroundColor
|
||||
if self.focused then
|
||||
|
@ -347,7 +347,7 @@ function Browser:eventHandler(event)
|
||||
self:run('cedit', file.name)
|
||||
|
||||
elseif event.type == 'shell' then
|
||||
self:run('sys/apps/shell')
|
||||
self:run('sys/apps/shell.lua')
|
||||
|
||||
elseif event.type == 'refresh' then
|
||||
self:updateDirectory(self.dir)
|
||||
|
@ -1,8 +1,5 @@
|
||||
if not _G.requireInjector then
|
||||
local BASE ='https://raw.githubusercontent.com/kepler155c/opus/develop-1.8/sys/apis'
|
||||
_ENV.LUA_PATH=BASE .. '/?.lua'
|
||||
load(_G.http.get(BASE .. '/injector.lua').readAll())()(_ENV)
|
||||
end
|
||||
-- Lua may be called from outside of shell - inject a require
|
||||
_G.requireInjector(_ENV)
|
||||
|
||||
local History = require('history')
|
||||
local UI = require('ui')
|
||||
|
@ -424,7 +424,7 @@ function page:eventHandler(event)
|
||||
shell.switchTab(shell.openTab(event.button.app.run))
|
||||
|
||||
elseif event.type == 'shell' then
|
||||
shell.switchTab(shell.openTab('sys/apps/shell'))
|
||||
shell.switchTab(shell.openTab('sys/apps/shell.lua'))
|
||||
|
||||
elseif event.type == 'lua' then
|
||||
shell.switchTab(shell.openTab('sys/apps/Lua.lua'))
|
||||
|
@ -36,7 +36,6 @@ local page = UI.Page {
|
||||
description = UI.TextArea {
|
||||
x = 16, y = 3, ey = -5,
|
||||
marginRight = 0, marginLeft = 0,
|
||||
--backgroundColor = colors.white,
|
||||
},
|
||||
load = UI.Button {
|
||||
x = 22, y = -3,
|
||||
@ -45,10 +44,8 @@ local page = UI.Page {
|
||||
help = 'Download the latest package list',
|
||||
},
|
||||
action = UI.SlideOut {
|
||||
backgroundColor = colors.brown,
|
||||
y = 3,
|
||||
backgroundColor = colors.cyan,
|
||||
titleBar = UI.TitleBar {
|
||||
backgroundColor = colors.brown,
|
||||
event = 'hide-action',
|
||||
},
|
||||
button = UI.Button {
|
||||
|
@ -314,9 +314,9 @@ function shell.newTab(tabInfo, ...)
|
||||
tabInfo.args = args
|
||||
tabInfo.title = fs.getName(path):match('([^%.]+)')
|
||||
|
||||
if path ~= 'sys/apps/shell' then
|
||||
if path ~= 'sys/apps/shell.lua' then
|
||||
table.insert(tabInfo.args, 1, tabInfo.path)
|
||||
tabInfo.path = 'sys/apps/shell'
|
||||
tabInfo.path = 'sys/apps/shell.lua'
|
||||
end
|
||||
return _ENV.multishell.openTab(tabInfo)
|
||||
end
|
||||
@ -329,10 +329,10 @@ function shell.openTab( ... )
|
||||
local sCommand = tWords[1]
|
||||
if sCommand then
|
||||
local sPath = shell.resolveProgram(sCommand)
|
||||
if sPath == "sys/apps/shell" then
|
||||
if sPath == "sys/apps/shell.lua" then
|
||||
return _ENV.multishell.launch(Util.shallowCopy(sandboxEnv), sPath, table.unpack(tWords, 2))
|
||||
else
|
||||
return _ENV.multishell.launch(Util.shallowCopy(sandboxEnv), "sys/apps/shell", sCommand, table.unpack(tWords, 2))
|
||||
return _ENV.multishell.launch(Util.shallowCopy(sandboxEnv), "sys/apps/shell.lua", sCommand, table.unpack(tWords, 2))
|
||||
end
|
||||
end
|
||||
end
|
3
sys/autorun/upgraded.lua
Normal file
3
sys/autorun/upgraded.lua
Normal file
@ -0,0 +1,3 @@
|
||||
if fs.exists('sys/apps/shell') and fs.exists('sys/apps/shell.lua') then
|
||||
fs.delete('sys/apps/shell')
|
||||
end
|
@ -64,7 +64,7 @@ else
|
||||
fs.mount('', 'gitfs', GIT_REPO)
|
||||
end
|
||||
|
||||
local s, m = pcall(run, 'sys/apps/shell', 'sys/kernel.lua', ...)
|
||||
local s, m = pcall(run, 'sys/apps/shell.lua', 'sys/kernel.lua', ...)
|
||||
|
||||
if not s then
|
||||
print('\nError loading Opus OS\n')
|
||||
|
@ -278,7 +278,7 @@ local function init(...)
|
||||
kernel.hook('kernel_ready', function()
|
||||
local s, m = kernel.run({
|
||||
title = args[1],
|
||||
path = 'sys/apps/shell',
|
||||
path = 'sys/apps/shell.lua',
|
||||
args = args,
|
||||
haltOnExit = true,
|
||||
haltOnError = true,
|
||||
|
@ -46,7 +46,7 @@ local function telnetHost(socket)
|
||||
title = 'Telnet client',
|
||||
hidden = true,
|
||||
co = coroutine.create(function()
|
||||
Util.run(_ENV, 'sys/apps/shell', table.unpack(termInfo.program))
|
||||
Util.run(_ENV, 'sys/apps/shell.lua', table.unpack(termInfo.program))
|
||||
if socket.queue then
|
||||
socket:write(socket.queue)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user