-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
50 lines (46 loc) · 1.41 KB
/
init.lua
File metadata and controls
50 lines (46 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
local osRun = os.run
local osShutdown = os.shutdown
function os.run() -- avoid calling at line 988 bios.lua
os.run = osRun
end
-- at the end of bios.lua this function is executed
function os.shutdown()
os.shutdown = osShutdown
local ok, err = pcall(parallel.waitForAny, function()
local sShell
if term.isColour() and settings.get("bios.use_multishell") then
sShell = "rom/programs/advanced/multishell.lua"
else
sShell = "rom/programs/shell.lua"
end
os.run({ shell = shell, multishell = multishell }, sShell)
os.run({}, "rom/programs/shutdown.lua")
end, function()
if fs.exists("sysc/syscd.lua") then
os.run({
shell = shell,
require = require,
package = package,
multishell = multishell,
}, "/sysc/syscd.lua")
else
while true do
coroutine.yield("-")
end
end
end)
-- If the shell errored, let the user read it.
term.redirect(term.native())
if not ok then
printError(err)
pcall(function()
term.setCursorBlink(false)
print("Press any key to continue")
os.pullEvent("key")
end)
end
-- End
os.shutdown()
end
debug.setupvalue(rednet.run, 1, false) -- set "started" to off
shell.exit() -- exit shell at line 987 bios.lua