From nobody Sun Sep 22 19:46:29 2024 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBc82758Jz5Xl42 for ; Sun, 22 Sep 2024 19:46:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XBc826ZFMz4scB for ; Sun, 22 Sep 2024 19:46:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2d877e9054eso2554367a91.3 for ; Sun, 22 Sep 2024 12:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1727034402; x=1727639202; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/iKdOpzRpk7UOgvIkuCrQnWoIlVOz6olQN8nYaGZryw=; b=XmzAWcgx5alNDJPOj5+EpbBFG3L5FGwEvdRIeT6NOMhGEtHcPp1CJvPCIB+oLOmMyb oho8HpMdLeyCnODpufrkRZvuqpDpvgu9OtRczZoxIkAt9eci6q1vl0XkLiLghmuSrjrh PjnLkyNeaFb67WM6w0o/rSZNiYx8bXa4il9SzKnfa6CSEfu8qeaSjvwqhE9xUhfNZH1s TJcqZ53J9x0vdXRUAnZoZ+e31oaNyEHhDaTcLDmq/xfXJxEnIDlSG0by2+MVKg19lcgm VNbW3Ru6ShEVvsHf01FK08ud40NnIoQ4WI6RTVnycxPDfFU12TLCpA1QgqaQsJVS4Dfj nBgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727034402; x=1727639202; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/iKdOpzRpk7UOgvIkuCrQnWoIlVOz6olQN8nYaGZryw=; b=luGqQHT7oghpBBFaI7MYo3ttFbq+AWIkhtnazMJepTMxvw90cq2qGP8wp6cD8YHnDa YGHdSXajTOjJY2+d0KRqY9miPrIgUBenujf+k4/hRcsKtwaIWCfhQh7e5Gdag455O4Jg NZm+BDNaFzE3z5TOZicR0Y9ZjY3Wjya+dv/kaGbDlaRROTMepUVS5sidxEeeOmANVq77 PPlacQoA++ag3Wyye17B5yI3Xfzg01SVNwUoo8LHlbJrEftX4M6r4oMtqudnjnIsxSNO ygJWLy8xtJgoDE5NiCZ+VcZYxWSL4KMGmUckobZWfUpP5s4rea/mFeY6bHZfom9Q+4fk dSXw== X-Gm-Message-State: AOJu0Yzjji5po1sex0PqDLPYZbrjcA951RfXb4GLBHZ/kEZpQ6tb92Ep PU5sKUeDGrMDihZf7rsV7CSJVAcHJBh6fhbnu1jj8oy/FcuwgVhyMU0dcg/4nxvD2+hRDJ/ix/L hJpqK7bJR7SeI7RSwSytDjectJURw49k4wT6yFYBlphZaRP/awwG+rg== X-Google-Smtp-Source: AGHT+IHVppq4Kx3VmSARVPeMw5QSH+hXKZ9/1FjligW6pZ5DrkkXLuBa8tLzCn5eiEW07D+FrGYVo3odB2iGMR6Ee6U= X-Received: by 2002:a17:90a:b117:b0:2d8:7572:4bc1 with SMTP id 98e67ed59e1d1-2dd7f3806abmr12169051a91.1.1727034401752; Sun, 22 Sep 2024 12:46:41 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: <2661b46d-b1bb-4731-acbd-75a7fb3c6233@blastwave.org> In-Reply-To: <2661b46d-b1bb-4731-acbd-75a7fb3c6233@blastwave.org> From: Warner Losh Date: Sun, 22 Sep 2024 20:46:29 +0100 Message-ID: Subject: Re: regarding that stack of newline chars expressed at boot To: Dennis Clarke Cc: FreeBSD Current Content-Type: multipart/alternative; boundary="0000000000000826e70622ba8879" X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XBc826ZFMz4scB X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --0000000000000826e70622ba8879 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 =3D 1, str.len() do + printc(str[i]) + end +end + function menu.autoboot(delay) local x =3D loader.getenv("loader_menu_timeout_x") or 4 local y =3D loader.getenv("loader_menu_timeout_y") or 24 @@ -544,7 +552,7 @@ function menu.autoboot(delay) if last =3D=3D nil or last ~=3D time then last =3D 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=E2=80=AFPM Dennis Clarke 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=3D101afbc6ee2f06f77e6886f1f3ffe11= 5c579967c > > 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 > > --0000000000000826e70622ba8879 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Consider the following (cut and pasted, so you may ne= ed to tweak).

Warner

diff --gi= t a/stand/lua/menu.lua b/stand/lua/menu.lua
index ed84360d93b0..bab99b79= c253 100644
--- a/stand/lua/menu.lua
+++ b/stand/lua/menu.lua
@@ -= 533,6 +533,14 @@ function menu.run()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 print(&= quot;Exiting menu!")
=C2=A0end

+local function print_str(str= )
+ local i
+
+ for i =3D 1, str.len() do
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 printc(str[i])
+ end
+end
+
=C2=A0function menu.auto= boot(delay)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 local x =3D loader.getenv("= loader_menu_timeout_x") or 4
=C2=A0 =C2=A0 =C2=A0 =C2=A0 local y = =3D loader.getenv("loader_menu_timeout_y") or 24
@@ -544,7 +55= 2,7 @@ function menu.autoboot(delay)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 if last =3D=3D nil or last ~=3D time then
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 last =3D time
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 screen.setcursor(x, y)
- =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 print("Autoboot in &q= uot; .. time ..
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 print_str("Autoboot in " .. time ..
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 " seconds. [Space] to pause ")
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 screen.defcursor()=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end
On Sun, = Sep 22, 2024 at 6:15=E2=80=AFPM Dennis Clarke <dclarke@blastwave.org> wrote:


This is from the "better late than never" file. So yes, any machi= ne 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 se= cs
and so therefore I was seeing ten lines of stuff.

Seems to be related to :


https://cgit.freeb= sd.org/src/commit/?id=3D101afbc6ee2f06f77e6886f1f3ffe115c579967c

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=C2=A0 me paint the bikeshed.


--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken

--0000000000000826e70622ba8879--