transition tot kernel
This commit is contained in:
@@ -3,26 +3,41 @@ _G.requireInjector()
|
||||
local Terminal = require('terminal')
|
||||
local Util = require('util')
|
||||
|
||||
local kernel = _G.kernel
|
||||
local keyboard = _G.device.keyboard
|
||||
local multishell = _ENV.multishell
|
||||
local os = _G.os
|
||||
local term = _G.term
|
||||
|
||||
multishell.setTitle(multishell.getCurrent(), 'Debug')
|
||||
_ENV._APP_TITLE = 'Debug'
|
||||
|
||||
term.redirect(Terminal.scrollable(term.current(), 50))
|
||||
|
||||
local tabId = multishell.getCurrent()
|
||||
local terminal = term.current()
|
||||
local previousId
|
||||
|
||||
_G.debug = function(pattern, ...)
|
||||
local oldTerm = term.current()
|
||||
term.redirect(terminal)
|
||||
term.redirect(kernel.terminal)
|
||||
Util.print(pattern, ...)
|
||||
term.redirect(oldTerm)
|
||||
end
|
||||
|
||||
kernel.hook('mouse_scroll', function(_, eventData)
|
||||
local dir, y = eventData[1], eventData[3]
|
||||
|
||||
if y > 1 then
|
||||
local currentTab = kernel.routines[1]
|
||||
if currentTab.terminal.scrollUp then
|
||||
if dir == -1 then
|
||||
currentTab.terminal.scrollUp()
|
||||
else
|
||||
currentTab.terminal.scrollDown()
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
print('Debug started')
|
||||
print('Press ^d to activate debug window')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user