From 0dd13b74f185a3a5dd22a37fccfa63dc276c9a55 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Sun, 12 Apr 2020 03:49:14 +1000 Subject: [PATCH] fixed [n;nH scrolling the display --- lib/vtansi.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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