git: bf0b82f8292d - stable/13 - loader: Use printc instead of print to fit in 24,80
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 28 Dec 2024 18:54:58 UTC
The branch stable/13 has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=bf0b82f8292db384199495ab457f00bcfa3e8c2c
commit bf0b82f8292db384199495ab457f00bcfa3e8c2c
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-09-24 16:52:18 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-12-28 18:14:31 +0000
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 101afbc6ee2f0.
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: 101afbc6ee2f0
Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D46771
(cherry picked from commit 3fb656f8ef21332d96de8097521aaa51ddeb649d)
---
stand/lua/menu.lua | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua
index 894c0af69d35..1d4c203bef40 100644
--- a/stand/lua/menu.lua
+++ b/stand/lua/menu.lua
@@ -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