Date: Sun, 22 Sep 2024 20:46:29 +0100 From: Warner Losh <imp@bsdimp.com> To: Dennis Clarke <dclarke@blastwave.org> Cc: FreeBSD Current <current@freebsd.org> Subject: Re: regarding that stack of newline chars expressed at boot Message-ID: <CANCZdfoQwxUvfY=Y2Z-s9k3h-kK=rJxVR4gxs1weR5DtXyoMhA@mail.gmail.com> In-Reply-To: <2661b46d-b1bb-4731-acbd-75a7fb3c6233@blastwave.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
Consider the following (cut and pasted, so you may need to tweak).
Warner
diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua
index ed84360d93b0..bab99b79c253 100644
--- a/stand/lua/menu.lua
+++ b/stand/lua/menu.lua
@@ -533,6 +533,14 @@ function menu.run()
print("Exiting menu!")
end
+local function print_str(str)
+ local i
+
+ for i = 1, str.len() do
+ printc(str[i])
+ end
+end
+
function menu.autoboot(delay)
local x = loader.getenv("loader_menu_timeout_x") or 4
local y = loader.getenv("loader_menu_timeout_y") or 24
@@ -544,7 +552,7 @@ function menu.autoboot(delay)
if last == nil or last ~= time then
last = time
screen.setcursor(x, y)
- print("Autoboot in " .. time ..
+ print_str("Autoboot in " .. time ..
" seconds. [Space] to pause ")
screen.defcursor()
end
On Sun, Sep 22, 2024 at 6:15 PM Dennis Clarke <dclarke@blastwave.org> wrote:
>
>
> This is from the "better late than never" file. So yes, any machine I
> had with a serial console was kicking out a newline char on every one
> of the "autoboot_delay" countdown. Seems to be a default of 10 secs
> and so therefore I was seeing ten lines of stuff.
>
> Seems to be related to :
>
>
>
> https://cgit.freebsd.org/src/commit/?id=101afbc6ee2f06f77e6886f1f3ffe115c579967c
>
> The trivial solution is to NOT use and old fashioned 80x24 DEC VT100
> type XTerm size for the session that connects to serial. The behavior
> vanishes at 80x25 now. I see that as the old DOS PC-Term size that some
> folks at Microsoft loved. Many years ago.
>
> Maybe it would be more elegant to just output the countdown secs number
> and then utter 010 BS chars and keep kicking out numbers that overwrite
> whatever was there before?
>
> Or do nothing.
>
> Hardly an issue really. Just seemed weird when I saw it.
>
> Thanks for letting me paint the bikeshed.
>
>
> --
> Dennis Clarke
> RISC-V/SPARC/PPC/ARM/CISC
> UNIX and Linux spoken
>
>
[-- Attachment #2 --]
<div dir="ltr"><div>Consider the following (cut and pasted, so you may need to tweak).</div><div><br></div><div>Warner</div><div><br></div>diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua<br>index ed84360d93b0..bab99b79c253 100644<br>--- a/stand/lua/menu.lua<br>+++ b/stand/lua/menu.lua<br>@@ -533,6 +533,14 @@ function menu.run()<br> print("Exiting menu!")<br> end<br><br>+local function print_str(str)<br>+ local i<br>+<br>+ for i = 1, str.len() do<br>+ printc(str[i])<br>+ end<br>+end<br>+<br> function menu.autoboot(delay)<br> local x = loader.getenv("loader_menu_timeout_x") or 4<br> local y = loader.getenv("loader_menu_timeout_y") or 24<br>@@ -544,7 +552,7 @@ function menu.autoboot(delay)<br> if last == nil or last ~= time then<br> last = time<br> screen.setcursor(x, y)<br>- print("Autoboot in " .. time ..<br>+ print_str("Autoboot in " .. time ..<br> " seconds. [Space] to pause ")<br> screen.defcursor()<br> end<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Sep 22, 2024 at 6:15 PM Dennis Clarke <<a href="mailto:dclarke@blastwave.org">dclarke@blastwave.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
This is from the "better late than never" file. So yes, any machine I<br>
had with a serial console was kicking out a newline char on every one<br>
of the "autoboot_delay" countdown. Seems to be a default of 10 secs<br>
and so therefore I was seeing ten lines of stuff.<br>
<br>
Seems to be related to :<br>
<br>
<br>
<a href="https://cgit.freebsd.org/src/commit/?id=101afbc6ee2f06f77e6886f1f3ffe115c579967c" rel="noreferrer" target="_blank">https://cgit.freebsd.org/src/commit/?id=101afbc6ee2f06f77e6886f1f3ffe115c579967c</a><br>
<br>
The trivial solution is to NOT use and old fashioned 80x24 DEC VT100<br>
type XTerm size for the session that connects to serial. The behavior<br>
vanishes at 80x25 now. I see that as the old DOS PC-Term size that some<br>
folks at Microsoft loved. Many years ago.<br>
<br>
Maybe it would be more elegant to just output the countdown secs number<br>
and then utter 010 BS chars and keep kicking out numbers that overwrite<br>
whatever was there before?<br>
<br>
Or do nothing.<br>
<br>
Hardly an issue really. Just seemed weird when I saw it.<br>
<br>
Thanks for letting me paint the bikeshed.<br>
<br>
<br>
--<br>
Dennis Clarke<br>
RISC-V/SPARC/PPC/ARM/CISC<br>
UNIX and Linux spoken<br>
<br>
</blockquote></div>
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoQwxUvfY=Y2Z-s9k3h-kK=rJxVR4gxs1weR5DtXyoMhA>
