1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00

loader: Use printc instead of print to fit in 24,80

print automatically adds a newline, while printc does not. Use printc in
preference to print for managing the autoboot message. This means we can
use line 24 safely on a 24x80 terminal, restoring some functionality
that was lost in 101afbc6ee.

Note: we still set the default curosor position to 25,1 in screen.lua,
but real VT100s (and successors) will treat any row larger than the
pnumber of rows in a cursor motion command to be the last physical row
(this is so you can move to 9999,9999 and do a cursor location query to
get the size of the screen). Keeping that as is looks better on a
typical VGA console.

Fixes: 101afbc6ee
Sponsored by: Netflix
Reviewed by: kevans
Differential Revision:	https://reviews.freebsd.org/D46771
This commit is contained in:
Warner Losh 2024-09-24 10:52:18 -06:00
parent 044f94adff
commit 3fb656f8ef

View File

@ -530,6 +530,7 @@ function menu.run()
drawn_menu = nil
screen.defcursor()
-- We explicitly want the newline print adds
print("Exiting menu!")
end
@ -544,7 +545,7 @@ function menu.autoboot(delay)
if last == nil or last ~= time then
last = time
screen.setcursor(x, y)
print("Autoboot in " .. time ..
printc("Autoboot in " .. time ..
" seconds. [Space] to pause ")
screen.defcursor()
end
@ -553,9 +554,12 @@ function menu.autoboot(delay)
if ch == core.KEY_ENTER then
break
else
-- erase autoboot msg
-- Erase autoboot msg. While real VT100s
-- wouldn't scroll when receiving a char with
-- the cursor at (24, 79), bad emulators do.
-- Avoid the issue by stopping at 79.
screen.setcursor(0, y)
print(string.rep(" ", 80))
printc(string.rep(" ", 79))
screen.defcursor()
return ch
end