This commit is contained in:
kepler155c@gmail.com
2020-05-10 14:04:42 -06:00
parent d902acacf4
commit 759e4e2b95
4 changed files with 16 additions and 16 deletions

View File

@@ -132,7 +132,7 @@ end
function methodsPage:getDocumentation() function methodsPage:getDocumentation()
local method = self.grid:getSelected() local method = self.grid:getSelected()
if method.noext then -- computercraft docs if not method or method.noext then -- computercraft docs
return 'No documentation' return 'No documentation'
end end

View File

@@ -23,7 +23,7 @@ local colours = _G.colors
local args, options = Util.parse(...) local args, options = Util.parse(...)
local oldTerm, showInput, skipLast, lastDelay, curInput = Util.shallowCopy(multishell.term), false, false, 2, "" local oldTerm, showInput, skipLast, lastDelay, curInput = Util.shallowCopy(_G.device.terminal), false, false, 2, ""
local curBlink, oldBlink, tTerm, buffer, colourNum, xPos, yPos, oldXPos, oldYPos, tCol, bCol, xSize, ySize = false, false, {}, {}, {}, 1, 1, 1, 1, colours.white, colours.black, oldTerm.getSize() local curBlink, oldBlink, tTerm, buffer, colourNum, xPos, yPos, oldXPos, oldYPos, tCol, bCol, xSize, ySize = false, false, {}, {}, {}, 1, 1, 1, 1, colours.white, colours.black, oldTerm.getSize()
local greys, buttons = {["0"] = true, ["7"] = true, ["8"] = true, ["f"] = true}, {"l", "r", "m"} local greys, buttons = {["0"] = true, ["7"] = true, ["8"] = true, ["f"] = true}, {"l", "r", "m"}
local charW, charH, chars local charW, charH, chars
@@ -60,7 +60,7 @@ if options.help then
end end
if options.daemon then if options.daemon then
device.keyboard.addHotkey('control-P', function() _G.device.keyboard.addHotkey('control-P', function()
multishell.openTab({ multishell.openTab({
path = 'sys/apps/shell.lua', path = 'sys/apps/shell.lua',
args = { arg[0], '--noResize', '--rawOutput', 'recorder.gif' }, args = { arg[0], '--noResize', '--rawOutput', 'recorder.gif' },
@@ -141,7 +141,7 @@ end
-- Build a terminal that records stuff: -- Build a terminal that records stuff:
local recTerm = multishell.term local recTerm = _G.device.terminal
for key, func in pairs(oldTerm) do for key, func in pairs(oldTerm) do
if type(func) == 'function' then if type(func) == 'function' then
@@ -153,7 +153,7 @@ for key, func in pairs(oldTerm) do
end end
callCount = callCount + 1 callCount = callCount + 1
curCalls[callCount] = { key, ... } curCalls[callCount] = { key, ... }
return unpack(result) return table.unpack(result)
end end
end end
end end
@@ -196,7 +196,7 @@ end
_G.device.keyboard.removeHotkey('control-p') _G.device.keyboard.removeHotkey('control-p')
for k,fn in pairs(oldTerm) do for k,fn in pairs(oldTerm) do
multishell.term[k] = fn _G.device.terminal[k] = fn
end end
multishell.unhideTab(tabId) multishell.unhideTab(tabId)

View File

@@ -2,7 +2,6 @@ local Event = require('opus.event')
local Socket = require('opus.socket') local Socket = require('opus.socket')
local Util = require('opus.util') local Util = require('opus.util')
local multishell = _ENV.multishell
local os = _G.os local os = _G.os
local remoteId local remoteId
@@ -23,7 +22,7 @@ local function wrapTerm(socket)
'setTextColor', 'setTextColour', 'setBackgroundColor', 'setTextColor', 'setTextColour', 'setBackgroundColor',
'setBackgroundColour', 'scroll', 'setCursorBlink', } 'setBackgroundColour', 'scroll', 'setCursorBlink', }
socket.term = multishell.term socket.term = _G.device.terminal
socket.oldTerm = Util.shallowCopy(socket.term) socket.oldTerm = Util.shallowCopy(socket.term)
for _,k in pairs(methods) do for _,k in pairs(methods) do

View File

@@ -31,10 +31,10 @@ local events = {
} }
local function hook(e, eventData) local function hook(e, eventData)
local currentTab = kernel.getFocused() local current = kernel.getFocused()
local x = math.floor(eventData[2] / xs) local x = math.floor(eventData[2] / xs)
local y = math.floor(eventData[3] / ys) local y = math.floor(eventData[3] / ys)
local clickedTab local clicked
if dragging then if dragging then
if e == 'glasses_up' then if e == 'glasses_up' then
@@ -58,7 +58,7 @@ local function hook(e, eventData)
local ww, wh = tab.window.getSize() local ww, wh = tab.window.getSize()
if x >= wx and x <= wx + ww and y > wy and y < wy + wh then if x >= wx and x <= wx + ww and y > wy and y < wy + wh then
clickedTab = tab clicked = tab
x = x - wx x = x - wx
y = y - wy y = y - wy
break break
@@ -73,14 +73,14 @@ local function hook(e, eventData)
end end
end end
if clickedTab then if clicked then
if clickedTab ~= currentTab then if clicked ~= current then
clickedTab.window.raise() clicked.window.raise()
kernel.raise(clickedTab.uid) kernel.raise(clicked.uid)
end end
kernel.event(events[e], { kernel.event(events[e], {
eventData[1], x, y, clickedTab.window.side, eventData[1], x, y, clicked.window.side,
}) })
end end
@@ -104,6 +104,7 @@ local function run(args)
path = args.path, path = args.path,
args = args.args, args = args.args,
hidden = true, hidden = true,
title = fs.getName(args.path),
onExit = function(self) onExit = function(self)
Util.removeByValue(config.session, args) Util.removeByValue(config.session, args)
Config.update('nwm', config) Config.update('nwm', config)