1
0
mirror of https://github.com/kepler155c/opus synced 2025-11-01 08:03:00 +00:00

run autorun programs in shell mode

This commit is contained in:
kepler155c@gmail.com
2019-03-27 15:21:31 -04:00
parent 82f6d3451d
commit 8fede6f507
8 changed files with 127 additions and 96 deletions

View File

@@ -1,5 +1,3 @@
_G.requireInjector(_ENV)
local Util = require('util')
local kernel = _G.kernel

View File

@@ -4,6 +4,10 @@ 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

View File

@@ -1,5 +1,3 @@
_G.requireInjector(_ENV)
--[[
Adds a task and the control-d hotkey to view the kernel log.
--]]
@@ -13,12 +11,14 @@ local term = _G.term
local function systemLog()
local routine = kernel.getCurrent()
local w, h = kernel.window.getSize()
kernel.window.reposition(1, 2, w, h - 1)
if multishell and multishell.openTab then
local w, h = kernel.window.getSize()
kernel.window.reposition(1, 2, w, h - 1)
routine.terminal = kernel.window
routine.window = kernel.window
term.redirect(kernel.window)
routine.terminal = kernel.window
routine.window = kernel.window
term.redirect(kernel.window)
end
kernel.hook('mouse_scroll', function(_, eventData)
local dir, y = eventData[1], eventData[3]
@@ -50,8 +50,15 @@ local function systemLog()
keyboard.removeHotkey('control-d')
end
multishell.openTab({
title = 'System Log',
fn = systemLog,
hidden = true,
})
if multishell and multishell.openTab then
multishell.openTab({
title = 'System Log',
fn = systemLog,
hidden = true,
})
else
kernel.run({
title = 'Syslog',
fn = systemLog,
})
end

View File

@@ -3,7 +3,7 @@ local Config = require('config')
local shell = _ENV.shell
local config = Config.load('os')
if not config.welcomed then
if not config.welcomed and shell.openForegroundTab then
config.welcomed = true
Config.update('os', config)