peripheral overhaul

This commit is contained in:
kepler155c
2018-01-06 06:08:39 -05:00
parent c48243eae5
commit f2b9efc80f
8 changed files with 176 additions and 108 deletions

19
apps/termShare.lua Normal file
View File

@@ -0,0 +1,19 @@
local device = _G.device
local multishell = _ENV.multishell
local os = _G.os
local term = _G.term
-- list this terminal in the devices list so it's available via
-- peripheral sharing
local args = { ... }
local name = args[1] or error('Syntax: termShare [device name] <title>')
local title = args[2]
device[name] = term.current()
if title then
multishell.setTitle(multishell.getCurrent(), title)
end
os.pullEvent('char')
device[name] = nil