diff --git a/stand/lua/password.lua b/stand/lua/password.lua index d14dec675436..c8352ea519d7 100644 --- a/stand/lua/password.lua +++ b/stand/lua/password.lua @@ -47,7 +47,8 @@ function password.read(prompt_length) local function draw_twiddle() loader.printc(" " .. twiddle_chars[twiddle_pos]) - screen.setcursor(prompt_length + 2, 25) + -- Reset cursor to just after the password prompt + screen.setcursor(prompt_length + 2, screen.default_y) twiddle_pos = (twiddle_pos % #twiddle_chars) + 1 end diff --git a/stand/lua/screen.lua b/stand/lua/screen.lua index 04ab98817c32..7382e2ebbc68 100644 --- a/stand/lua/screen.lua +++ b/stand/lua/screen.lua @@ -34,6 +34,9 @@ local core = require("core") local screen = {} -- Module exports +screen.default_x = 0 +screen.default_y = 25 + function screen.clear() if core.isSerialBoot() then return @@ -71,7 +74,7 @@ function screen.defcursor() if core.isSerialBoot() then return end - loader.printc(core.KEYSTR_CSI .. "25;0H") + screen.setcursor(screen.default_x, screen.default_y) end return screen