From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DFCDEC77B61 for ; Mon, 24 Apr 2023 19:44:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D3FD0861B4; Mon, 24 Apr 2023 21:43:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="SCwER/3a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 508AA8619A; Mon, 24 Apr 2023 21:43:29 +0200 (CEST) Received: from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com [IPv6:2607:f8b0:4864:20::112a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E7D268613D for ; Mon, 24 Apr 2023 21:43:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-54f8f459b34so57449417b3.0 for ; Mon, 24 Apr 2023 12:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1682365403; x=1684957403; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=94VU3878sunbKkSC8axjLGs1F/XBFCYdgxpPU3fcQ/g=; b=SCwER/3aL+znw9qKB0AJ+ymCMAWaTcloUDbl3ONm298q6Rer26PFsL+PnDy+Mdh9O7 k3Ieys0aBO9UXH0bjLUqkUbdvcQ0R11BOKmY/hyWtoJf1EOTgb8JEK0US0TUfUKZYrvr Ps+XCYCLKOgNaRxvLjA4dcu8McLJVPcRMLMyE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682365403; x=1684957403; 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=94VU3878sunbKkSC8axjLGs1F/XBFCYdgxpPU3fcQ/g=; b=BCyeDSwPoE/lUrwIaBfypOsDyef7W7s9iS1BvCbB9Lz5WLE98gzjfnG8xJjGhMqDfb CtvFLv6z+dYUNyPvjNpgzxgykz4sTYOBKdbdHG5cfMVou4UfMxN3afnFO0O/EhtF0KNL MiFIkSR1iDrvjgUpA5ch9Mz1GDysuNVJxkTFmrEfs8WlY6zXOzEDwl3146fGDVyAA4/o 8vaXj4GlN0RZjEwowogNt9hvT0Mub5HDTbT2TSKW+HYpAJO7WRXdxwil9cC/Ufh1W0w+ gpkZc4H0v0YbsAK0kufZpKbXlhe+pfZIc1SPaVzhjVdkfL7A81NFIHHE2puk46o1Tpnj yB7w== X-Gm-Message-State: AAQBX9c1MjlZza6GogVr3UoeCFDnpTCnZ+yzKNjPIW2IN3j645nH+q11 UmrlU3ipu8HwNzGnt5mGOiSBXup4RcNfU47Yk/7pcg== X-Google-Smtp-Source: AKy350b7ipeje2fGczm05amkICHdUnV1DSCq9R8vqj/nZv8CXSrpoUYSt4xdRlta5xFpG5wzLcJklINiYYcxEfKE81o= X-Received: by 2002:a0d:e615:0:b0:54f:d233:d3b4 with SMTP id p21-20020a0de615000000b0054fd233d3b4mr9081350ywe.9.1682365403463; Mon, 24 Apr 2023 12:43:23 -0700 (PDT) MIME-Version: 1.0 References: <20230106145243.411626-1-sjg@chromium.org> <20230106145243.411626-9-sjg@chromium.org> <20230424014922.GT1134230@bill-the-cat> In-Reply-To: <20230424014922.GT1134230@bill-the-cat> From: Simon Glass Date: Mon, 24 Apr 2023 13:42:13 -0600 Message-ID: Subject: Re: [PATCH v3 08/25] menu: Make use of CLI character processing To: Tom Rini Cc: Daniel Golle , U-Boot Mailing List , Anatolij Gustschin , Heinrich Schuchardt Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Hi, On Sun, 23 Apr 2023 at 19:49, Tom Rini wrote: > > On Tue, Apr 18, 2023 at 07:49:34PM -0600, Simon Glass wrote: > > Hi Daniel, > > > > On Tue, 11 Apr 2023 at 14:19, Daniel Golle 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 > > > > --- > > > > > > > > [...] > > > > 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? > > As a new CONFIG symbol, default y for the old behavior please. > > > > 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. > > Well, I think for starting we can just make the behavior configurable at > build time. I'm not sure we need to do run-time (not clear if you're > suggesting that or not), and I don't know if code changes to deal with > ANSI-or-not would result in some unreasonable code growth here. My main goal is to avoid this stuff in test logs, so mostly sandbox, and having it configurable at runtime (for sandbox) would be ideal. Making it build-time configuration is fine as a starting point. Regards, Simon