diff --git a/modules/drivers/fastty.lua b/modules/drivers/fastty.lua index 1dc46d1..465d1e5 100644 --- a/modules/drivers/fastty.lua +++ b/modules/drivers/fastty.lua @@ -12,7 +12,9 @@ function tty(gA,sA,sI,mx,my) local function wl(s) s=tostring(s) or "" - for c in s:gmatch(".") do + for i = 1,unicode.len(s) do + local c = "" + c=unicode.sub(s,i,i) if c == "\f" then for i = 1, sy do sb[i] = nil @@ -38,7 +40,7 @@ function tty(gA,sA,sI,mx,my) if sb[cy]:len() > sx then sb[cy] = sb[cy]:sub(1,sx) end - cx=cx+1 + cx=cx+unicode.charWidth(c) end end end @@ -67,6 +69,7 @@ function tty(gA,sA,sI,mx,my) if si == sI then wl(str) rd() + gpu.set(cx,cy,"█") end end end,{sI=sI})