mirror of
https://git.shadowkat.net/izaya/OC-PsychOS2.git
synced 2024-11-30 22:42:17 -05:00
Compare commits
4 Commits
f95124996c
...
e3069f94a3
Author | SHA1 | Date | |
---|---|---|---|
|
e3069f94a3 | ||
|
f9749ac181 | ||
|
642eb9adf1 | ||
|
b4db6c7226 |
@ -1,7 +1,6 @@
|
|||||||
local computer = require "computer"
|
local computer = require "computer"
|
||||||
local minitel = require "minitel"
|
local minitel = require "minitel"
|
||||||
local event = require "event"
|
local event = require "event"
|
||||||
local ufs = require "unionfs"
|
|
||||||
local rpc = require "rpc"
|
local rpc = require "rpc"
|
||||||
local netutil = {}
|
local netutil = {}
|
||||||
|
|
||||||
@ -16,7 +15,7 @@ end
|
|||||||
|
|
||||||
function netutil.exportfs(path) -- string -- boolean -- Export the directory *path* over RPC.
|
function netutil.exportfs(path) -- string -- boolean -- Export the directory *path* over RPC.
|
||||||
local path = "/"..table.concat(fs.segments(path),"/")
|
local path = "/"..table.concat(fs.segments(path),"/")
|
||||||
local px = ufs.create(path)
|
local px = require("unionfs").create(path)
|
||||||
for k,v in pairs(px) do
|
for k,v in pairs(px) do
|
||||||
rpc.register(path.."_"..k,v)
|
rpc.register(path.."_"..k,v)
|
||||||
print(path.."_"..k)
|
print(path.."_"..k)
|
||||||
|
@ -261,37 +261,28 @@ function buffer:read(...)
|
|||||||
io.write("\27[s\27[8m")
|
io.write("\27[s\27[8m")
|
||||||
local pos, buffer = 1, ""
|
local pos, buffer = 1, ""
|
||||||
local function redraw()
|
local function redraw()
|
||||||
io.write("\27[u")
|
io.write(string.format("\27[u%s \27[u\27[%iC",buffer,(#buffer-pos)+1))
|
||||||
io.write(buffer.." ")
|
|
||||||
io.write("\27[u")
|
|
||||||
io.write(buffer:sub(1,(#buffer-pos)+1))
|
|
||||||
end
|
end
|
||||||
while true do
|
while true do
|
||||||
syslog("top of readline loop")
|
|
||||||
char = readBytesOrChars(1)
|
char = readBytesOrChars(1)
|
||||||
if char == "\27" then
|
if char == "\27" then
|
||||||
if readBytesOrChars(1) == "[" then
|
if readBytesOrChars(1) == "[" then
|
||||||
syslog("escape code")
|
|
||||||
local args = {""}
|
local args = {""}
|
||||||
repeat
|
repeat
|
||||||
char = readBytesOrChars(1)
|
char = readBytesOrChars(1)
|
||||||
--[[
|
|
||||||
if char:match("%d") then
|
if char:match("%d") then
|
||||||
args[#args] = args[#args]..char
|
args[#args] = args[#args]..char
|
||||||
else
|
else
|
||||||
args[#args] = tonumber(args[#args])
|
args[#args] = tonumber(args[#args])
|
||||||
args[#args+1] = ""
|
args[#args+1] = ""
|
||||||
end
|
end
|
||||||
]]
|
|
||||||
until not char:match("[%d;]")
|
until not char:match("[%d;]")
|
||||||
if char == "C" then -- right
|
if char == "C" then -- right
|
||||||
if pos > 1 then
|
if pos > 1 then
|
||||||
syslog("moving right")
|
|
||||||
pos = pos - 1
|
pos = pos - 1
|
||||||
end
|
end
|
||||||
elseif char == "D" then -- left
|
elseif char == "D" then -- left
|
||||||
if pos <= #buffer then
|
if pos <= #buffer then
|
||||||
syslog("moving left")
|
|
||||||
pos = pos + 1
|
pos = pos + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -305,7 +296,6 @@ function buffer:read(...)
|
|||||||
if chop then buffer = buffer .. "\n" end
|
if chop then buffer = buffer .. "\n" end
|
||||||
return buffer
|
return buffer
|
||||||
else
|
else
|
||||||
syslog("char: "..tostring(string.byte(char)))
|
|
||||||
buffer = buffer:sub(1, (#buffer - pos) + 1) .. char .. buffer:sub((#buffer - pos) + 2)
|
buffer = buffer:sub(1, (#buffer - pos) + 1) .. char .. buffer:sub((#buffer - pos) + 2)
|
||||||
end
|
end
|
||||||
redraw()
|
redraw()
|
||||||
|
Loading…
Reference in New Issue
Block a user