1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-25 12:47:41 +00:00
This commit is contained in:
kepler155c@gmail.com
2019-12-07 12:04:58 -07:00
parent 424fff7842
commit 28b2ba3386
6 changed files with 85 additions and 101 deletions

View File

@@ -4,58 +4,45 @@ local kernel = _G.kernel
local keyboard = _G.device.keyboard
local multishell = _ENV.multishell
if not multishell or not multishell.getTabs then
return
end
-- overview
keyboard.addHotkey('control-o', function()
for _,tab in pairs(multishell.getTabs()) do
if tab.isOverview then
multishell.setFocus(tab.uid)
if multishell and multishell.getTabs then
-- restart tab
keyboard.addHotkey('control-backspace', function()
local tab = kernel.getFocused()
if tab and not tab.noTerminate then
multishell.terminate(tab.uid)
multishell.openTab({
path = tab.path,
env = tab.env,
args = tab.args,
focused = true,
})
end
end
end)
-- restart tab
keyboard.addHotkey('control-backspace', function()
local uid = multishell.getFocus()
local tab = kernel.find(uid)
if not tab.isOverview then
multishell.terminate(uid)
multishell.openTab({
path = tab.path,
env = tab.env,
args = tab.args,
focused = true,
})
end
end)
end)
end
-- next tab
keyboard.addHotkey('control-tab', function()
local tabs = multishell.getTabs()
local visibleTabs = { }
local currentTabId = multishell.getFocus()
local currentTab = kernel.getFocused()
local function compareTab(a, b)
return a.uid < b.uid
end
for _,tab in Util.spairs(tabs, compareTab) do
for _,tab in Util.spairs(kernel.routines, compareTab) do
if not tab.hidden and not tab.noFocus then
table.insert(visibleTabs, tab)
end
end
for k,tab in ipairs(visibleTabs) do
if tab.uid == currentTabId then
if tab.uid == currentTab.uid then
if k < #visibleTabs then
multishell.setFocus(visibleTabs[k + 1].uid)
kernel.raise(visibleTabs[k + 1].uid)
return
end
end
end
if #visibleTabs > 0 then
multishell.setFocus(visibleTabs[1].uid)
kernel.raise(visibleTabs[1].uid)
end
end)

View File

@@ -50,16 +50,9 @@ local function systemLog()
keyboard.removeHotkey('control-d')
end
if multishell and multishell.openTab then
multishell.openTab({
title = 'System Log',
fn = systemLog,
noTerminate = true,
hidden = true,
})
else
kernel.run({
title = 'Syslog',
fn = systemLog,
})
end
kernel.run({
title = 'System Log',
fn = systemLog,
noTerminate = true,
hidden = true,
})

View File

@@ -18,3 +18,7 @@ deleteIfExists('sys/autorun/gpshost.lua')
deleteIfExists('sys/apps/network/redserver.lua')
deleteIfExists('sys/apis')
deleteIfExists('sys/autorun/apps.lua')
deleteIfExists('sys/init/6.tl3.lua')
-- remove this file
deleteIfExists('sys/autorun/upgraded.lua')