[PATCH v3 08/25] menu: Make use of CLI character processing
Simon Glass
sjg at chromium.org
Wed Apr 19 03:49:34 CEST 2023
Hi Daniel,
On Tue, 11 Apr 2023 at 14:19, Daniel Golle <daniel at makrotopia.org> wrote:
>
> On Fri, Jan 06, 2023 at 08:52:26AM -0600, Simon Glass wrote:
> > Avoid duplicating some of the escape-sequence processing here and use the
> > CLI function instead.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> > [...]
> > diff --git a/common/menu.c b/common/menu.c
> > index 7db98942a61..45f36ae3ede 100644
> > --- a/common/menu.c
> > +++ b/common/menu.c
> > @@ -15,6 +15,8 @@
> >
> > #include "menu.h"
> >
> > +#define ansi 0
>
> Now that I'm using U-Boot 2023.04 I noticed that this introduces a (cosmetic)
> regression: The autoboot countdown in bootmenu is now longer re-written, but
> instead the last menu item line is continously appended like:
>
> U-Boot consoleHit any key to stop autoboot: 3 Hit any key to stop autoboot: 2
>
> To regain the previous behavior one should change the line to
> #define ansi 1
Yes, perhaps you could send a patch?
>
> To me this looks a bit unfinished, as if there was some sort of
> probing of the terminal capabilities supposed to happen but then
> this has never been implemeneted...
I have expressed the review that ANSI should be something we can
enable or disable, rather than always having it enabled. For tests in
particular, ANSI is a pain since it messes up the logs with escape
sequences and it is hard to see what is happening.
IMO we should have an ANSI library which you call to emit sequences.
Or perhaps we could try to be clever and build them into printf() as
special strings, so long as we can avoid compiler warnings.
Regards,
SImon
More information about the U-Boot
mailing list