diff --git a/common/Devices.lua b/common/Devices.lua index 7710bd5..c9c5556 100644 --- a/common/Devices.lua +++ b/common/Devices.lua @@ -132,7 +132,7 @@ end function methodsPage:getDocumentation() local method = self.grid:getSelected() - if method.noext then -- computercraft docs + if not method or method.noext then -- computercraft docs return 'No documentation' end diff --git a/common/recorder.lua b/common/recorder.lua index 4ea8824..86dfc3c 100644 --- a/common/recorder.lua +++ b/common/recorder.lua @@ -23,7 +23,7 @@ local colours = _G.colors 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 greys, buttons = {["0"] = true, ["7"] = true, ["8"] = true, ["f"] = true}, {"l", "r", "m"} local charW, charH, chars @@ -60,7 +60,7 @@ if options.help then end if options.daemon then - device.keyboard.addHotkey('control-P', function() + _G.device.keyboard.addHotkey('control-P', function() multishell.openTab({ path = 'sys/apps/shell.lua', args = { arg[0], '--noResize', '--rawOutput', 'recorder.gif' }, @@ -141,7 +141,7 @@ end -- Build a terminal that records stuff: -local recTerm = multishell.term +local recTerm = _G.device.terminal for key, func in pairs(oldTerm) do if type(func) == 'function' then @@ -153,7 +153,7 @@ for key, func in pairs(oldTerm) do end callCount = callCount + 1 curCalls[callCount] = { key, ... } - return unpack(result) + return table.unpack(result) end end end @@ -196,7 +196,7 @@ end _G.device.keyboard.removeHotkey('control-p') for k,fn in pairs(oldTerm) do - multishell.term[k] = fn + _G.device.terminal[k] = fn end multishell.unhideTab(tabId) diff --git a/monitor/mirrorClient.lua b/monitor/mirrorClient.lua index 2e1aca7..b7c8091 100644 --- a/monitor/mirrorClient.lua +++ b/monitor/mirrorClient.lua @@ -2,7 +2,6 @@ local Event = require('opus.event') local Socket = require('opus.socket') local Util = require('opus.util') -local multishell = _ENV.multishell local os = _G.os local remoteId @@ -23,7 +22,7 @@ local function wrapTerm(socket) 'setTextColor', 'setTextColour', 'setBackgroundColor', 'setBackgroundColour', 'scroll', 'setCursorBlink', } - socket.term = multishell.term + socket.term = _G.device.terminal socket.oldTerm = Util.shallowCopy(socket.term) for _,k in pairs(methods) do diff --git a/neural/nwm.lua b/neural/nwm.lua index 00154f8..0fa4d29 100644 --- a/neural/nwm.lua +++ b/neural/nwm.lua @@ -31,10 +31,10 @@ local events = { } local function hook(e, eventData) - local currentTab = kernel.getFocused() + local current = kernel.getFocused() local x = math.floor(eventData[2] / xs) local y = math.floor(eventData[3] / ys) - local clickedTab + local clicked if dragging then if e == 'glasses_up' then @@ -58,7 +58,7 @@ local function hook(e, eventData) local ww, wh = tab.window.getSize() if x >= wx and x <= wx + ww and y > wy and y < wy + wh then - clickedTab = tab + clicked = tab x = x - wx y = y - wy break @@ -73,14 +73,14 @@ local function hook(e, eventData) end end - if clickedTab then - if clickedTab ~= currentTab then - clickedTab.window.raise() - kernel.raise(clickedTab.uid) + if clicked then + if clicked ~= current then + clicked.window.raise() + kernel.raise(clicked.uid) end kernel.event(events[e], { - eventData[1], x, y, clickedTab.window.side, + eventData[1], x, y, clicked.window.side, }) end @@ -104,6 +104,7 @@ local function run(args) path = args.path, args = args.args, hidden = true, + title = fs.getName(args.path), onExit = function(self) Util.removeByValue(config.session, args) Config.update('nwm', config)