fixed <ESC>[n;nH scrolling the display

This commit is contained in:
Izaya 2020-04-12 03:49:14 +10:00
parent fc127f8d3e
commit 0dd13b74f1

View File

@ -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