1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-24 12:17:40 +00:00

transition to kernel

This commit is contained in:
kepler155c@gmail.com
2018-01-13 15:17:26 -05:00
parent fc8d44b60d
commit bd37b57780
20 changed files with 336 additions and 223 deletions

View File

@@ -1,9 +1,8 @@
local injector = _G.requireInjector or load(http.get('https://raw.githubusercontent.com/kepler155c/opus/master/sys/apis/injector.lua').readAll())()
local injector = _G.requireInjector or load(_G.http.get('https://raw.githubusercontent.com/kepler155c/opus/master/sys/apis/injector.lua').readAll())()
injector()
local Event = require('event')
local History = require('history')
local Peripheral = require('peripheral')
local UI = require('ui')
local Util = require('util')

View File

@@ -128,6 +128,7 @@ function UI.VerticalTabBar:setParent()
c.x = 1
c.y = k + 1
c.ox, c.oy = c.x, c.y
c.ow = 8
c.width = 8
end
end

View File

@@ -20,11 +20,7 @@ local overviewId
local tabsDirty = false
local closeInd = Util.getVersion() >= 1.76 and '\215' or '*'
multishell.term = term.current() --deprecated
-- redirect kernel output to a window
kernel.window = window.create(parentTerm, 1, 2, w, h - 1, false)
kernel.terminal = kernel.window
multishell.term = parentTerm --deprecated
local config = {
standard = {
@@ -156,6 +152,7 @@ function multishell.hideTab(tabId)
local tab = kernel.find(tabId)
if tab then
tab.hidden = true
kernel.lower(tab.uid)
redrawMenu()
end
end
@@ -224,6 +221,7 @@ kernel.hook('multishell_redraw', function()
local currentTab = kernel.routines[1]
for _,tab in pairs(kernel.routines) do
tab.title = tab.env._APP_TITLE or tab.title
if tab.hidden and tab ~= currentTab then
tab.width = 0
else

View File

@@ -330,7 +330,7 @@ end
local tArgs = { ... }
if #tArgs > 0 then
local env = setmetatable(Util.shallowCopy(sandboxEnv), { __index = _G })
return run(_ENV, ...) -- maybe _ENV
return run(env, ...)
end
local Config = require('config')

View File

@@ -10,9 +10,9 @@ local os = _G.os
local read = _G.read
local term = _G.term
local args = Util.args({ ... })
local options, args = Util.args({ ... })
local remoteId = tonumber(table.remove(args.remainder, 1))
local remoteId = tonumber(table.remove(args, 1) or '')
if not remoteId then
print('Enter host ID')
remoteId = tonumber(read())
@@ -22,8 +22,8 @@ if not remoteId then
error('Syntax: telnet [-title TITLE] ID [PROGRAM]')
end
if args.title then
multishell.setTitle(multishell.getCurrent(), args.title)
if options.title then
multishell.setTitle(multishell.getCurrent(), options.title)
end
print('connecting...')
@@ -43,7 +43,7 @@ socket:write({
width = w,
height = h,
isColor = ct.isColor(),
program = args.remainder,
program = args,
})
Event.addRoutine(function()
@@ -61,10 +61,10 @@ end)
ct.clear()
ct.setCursorPos(1, 1)
local filter = Util.transpose({
local filter = Util.transpose {
'char', 'paste', 'key', 'key_up', 'terminate',
'mouse_scroll', 'mouse_click', 'mouse_drag', 'mouse_up',
})
}
while true do
local e = { os.pullEventRaw() }