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

transition to kernel

This commit is contained in:
kepler155c@gmail.com
2018-01-20 07:18:13 -05:00
parent d85e9b96b2
commit 1c1eb9b782
28 changed files with 398 additions and 228 deletions

View File

@@ -1,18 +1,15 @@
local parentShell = _ENV.shell
_ENV.shell = { }
--_ENV.multishell = _ENV.multishell or { }
local fs = _G.fs
local shell = _ENV.shell
--local multishell = _ENV.multishell
local sandboxEnv = setmetatable({ }, { __index = _G })
for k,v in pairs(_ENV) do
sandboxEnv[k] = v
end
sandboxEnv.shell = shell
--sandboxEnv.multishell = multishell
_G.requireInjector()
@@ -64,7 +61,7 @@ local function run(env, ...)
end
if _ENV.multishell then
_ENV.multishell.setTitle(_ENV.multishell.getCurrent(), fs.getName(path))
_ENV.multishell.setTitle(_ENV.multishell.getCurrent(), fs.getName(path):match('([^%.]+)'))
end
if isUrl then
@@ -309,7 +306,7 @@ function shell.newTab(tabInfo, ...)
tabInfo.path = path
tabInfo.env = sandboxEnv
tabInfo.args = args
tabInfo.title = fs.getName(path)
tabInfo.title = fs.getName(path):match('([^%.]+)')
if path ~= 'sys/apps/shell' then
table.insert(tabInfo.args, 1, tabInfo.path)
@@ -345,6 +342,7 @@ end
local Config = require('config')
local History = require('history')
local Terminal = require('terminal')
local colors = _G.colors
local keys = _G.keys
@@ -352,6 +350,10 @@ local os = _G.os
local term = _G.term
local textutils = _G.textutils
local terminal = term.current()
Terminal.scrollable(terminal, 100)
terminal.noAutoScroll = true
local config = {
standard = {
textColor = colors.white,
@@ -567,6 +569,12 @@ local function shellRead(history)
sLine = ''
nPos = 0
redraw()
elseif sEvent == 'mouse_scroll' then
if param == -1 then
terminal.scrollUp()
else
terminal.scrollDown()
end
elseif sEvent == 'terminate' then
bExit = true
break