Warning: session_start(): open(/var/lib/php/sessions/sess_3gn886gnnijdl5lg27c0f39m5m, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
get("#137") -- string split
cursor = otherresults["#434"] or error("Need result of #434, please recalc")
screentext = otherresults["#437"] or error("Need result of #437, please recalc")
_, _, text = screentext:find("^Screen text on cursor line:\n(.*)")
if text == nil then print("Screen text not found") return end
_, _, cx, cy = cursor:find("Cursor position: (%d+)/(%d+)")
if cx == nil then print("Cursor not found") return end
cx, cy = tonumber(cx), tonumber(cy)
--lines = split(text, "\n")
--print("cy", cy, "lines", #lines)
--line = lines[cy]
line = text
--print("line", line, "cx", cx)
leftOfCursor = line:sub(1, cx-1)
print("leftOfCursor", leftOfCursor)
_, _, cmd = leftOfCursor:find("[#$] *(.*)")
if cmd == nil then return end
print("Command found: "..cmd)
if cmd == "ls- ltr" then
return "Suggested command correction: ".."ls -ltr"
end