1
1
mirror of https://git.shadowkat.net/izaya/OC-PsychOS2.git synced 2024-11-24 12:26:11 -05:00

Compare commits

...

4 Commits

2 changed files with 2 additions and 13 deletions

View File

@ -1,7 +1,6 @@
local computer = require "computer"
local minitel = require "minitel"
local event = require "event"
local ufs = require "unionfs"
local rpc = require "rpc"
local netutil = {}
@ -16,7 +15,7 @@ end
function netutil.exportfs(path) -- string -- boolean -- Export the directory *path* over RPC.
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
rpc.register(path.."_"..k,v)
print(path.."_"..k)

View File

@ -261,37 +261,28 @@ function buffer:read(...)
io.write("\27[s\27[8m")
local pos, buffer = 1, ""
local function redraw()
io.write("\27[u")
io.write(buffer.." ")
io.write("\27[u")
io.write(buffer:sub(1,(#buffer-pos)+1))
io.write(string.format("\27[u%s \27[u\27[%iC",buffer,(#buffer-pos)+1))
end
while true do
syslog("top of readline loop")
char = readBytesOrChars(1)
if char == "\27" then
if readBytesOrChars(1) == "[" then
syslog("escape code")
local args = {""}
repeat
char = readBytesOrChars(1)
--[[
if char:match("%d") then
args[#args] = args[#args]..char
else
args[#args] = tonumber(args[#args])
args[#args+1] = ""
end
]]
until not char:match("[%d;]")
if char == "C" then -- right
if pos > 1 then
syslog("moving right")
pos = pos - 1
end
elseif char == "D" then -- left
if pos <= #buffer then
syslog("moving left")
pos = pos + 1
end
end
@ -305,7 +296,6 @@ function buffer:read(...)
if chop then buffer = buffer .. "\n" end
return buffer
else
syslog("char: "..tostring(string.byte(char)))
buffer = buffer:sub(1, (#buffer - pos) + 1) .. char .. buffer:sub((#buffer - pos) + 2)
end
redraw()