Compare commits
No commits in common. "928a1db13c8662b8ea366301ea13cc1629ba9c52" and "fab605ff21b90e6b4b042f528800a95631f7b918" have entirely different histories.
928a1db13c
...
fab605ff21
@ -22,18 +22,17 @@ function shell.interactive()
|
|||||||
local shenv = setmetatable({}, {__index=shindex})
|
local shenv = setmetatable({}, {__index=shindex})
|
||||||
local run = true
|
local run = true
|
||||||
while run do
|
while run do
|
||||||
io.write(string.format("\27[32m%s:%s>\27[0m ",os.getenv("HOSTNAME") or "localhost",(os.getenv("PWD") or _VERSION)))
|
io.write(string.format("%s:%s> ",os.getenv("HOSTNAME") or "localhost",(os.getenv("PWD") or _VERSION)))
|
||||||
local input = io.read()
|
local input = io.read()
|
||||||
if input:sub(1,1) == "=" then
|
if input:sub(1,1) == "=" then
|
||||||
input = "return "..input:sub(2)
|
input = "return "..input:sub(2)
|
||||||
end
|
end
|
||||||
local f, r = load(input, "shell", "t", shenv)
|
local f, r = load(input, "shell", "t", shenv)
|
||||||
if not f then
|
if not f then
|
||||||
print("\27[31m"..r)
|
print(r)
|
||||||
else
|
else
|
||||||
local rt = {pcall(f)}
|
local rt = {pcall(f)}
|
||||||
local rs = table.remove(rt,1)
|
local rs = table.remove(rt,1)
|
||||||
if not rs then io.write("\27[31m") end
|
|
||||||
for k,v in pairs(rt) do
|
for k,v in pairs(rt) do
|
||||||
print(formatValue(v))
|
print(formatValue(v))
|
||||||
end
|
end
|
||||||
|
@ -31,8 +31,6 @@ function vt100emu(gpu) -- takes GPU component proxy *gpu* and returns a function
|
|||||||
cx = 1
|
cx = 1
|
||||||
elseif cc == "\27" then -- escape
|
elseif cc == "\27" then -- escape
|
||||||
mode = "e"
|
mode = "e"
|
||||||
elseif cc == "\t" then
|
|
||||||
cx = 8*((cx+9)//8)
|
|
||||||
elseif string.byte(cc) > 31 and string.byte(cc) < 127 then -- printable, I guess
|
elseif string.byte(cc) > 31 and string.byte(cc) < 127 then -- printable, I guess
|
||||||
gpu.set(cx, cy, cc)
|
gpu.set(cx, cy, cc)
|
||||||
cx = cx + 1
|
cx = cx + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user