diff --git a/lib/vtansi.lua b/lib/vtansi.lua index d5a247f..db23345 100644 --- a/lib/vtansi.lua +++ b/lib/vtansi.lua @@ -74,7 +74,7 @@ function vtansi.vtemu(gpu) -- takes GPU component proxy *gpu* and returns a func tA[#tA+1] = tonumber(s) end if cc == "H" then - cx, cy = tA[1] or 1, tA[2] or 1 + cx, cy = math.min(mx,tA[1] or 1), math.min(my,tA[2] or 1) elseif cc == "A" then cy = cy - (tA[1] or 1) elseif cc == "B" then @@ -89,6 +89,7 @@ function vtansi.vtemu(gpu) -- takes GPU component proxy *gpu* and returns a func cx, cy = sx, sy elseif cc == "n" and tA[1] == 6 then rs = string.format("%s\27[%d;%dR",rs,cx,cy) + dprint(string.format("reporting %d;%d as current cursor position",cx,cy)) elseif cc == "K" and tA[1] == 1 then gpu.fill(1,cy,cx,1," ") elseif cc == "K" and tA[1] == 2 then