From patchwork Mon Aug 25 16:27:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 130 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756139274; bh=RZhQwQhd5NBkOW9ntwHpH6OYDuwPqWGmMiKVEvUE7Ug=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=iUCjY5JtXbR5l2qTE59l0BUfLoe5J+hx8mA1HI5CJrVNwfKmvHVXWUgnBrXKmKrC0 X74a/HPeNdI4AwejhurNZ1aApTQYNItexyXWWUO05p9UxMiyBWtk2JqzGbtNOHuhLL IPd6QXomerezHiPnStltuEdKX/bLIAFwAoSDQW/H/p+RlueOkZwpal4q38J0Wvro0R rdX5xIIe4vNLxyT1+jI0O9vYDcsF+ktasWV38i79TwPvl5gL1/1YajzzyJfOhFUSh4 frY6XlyX1LCLte37YfZTwLbdu64MHj7w19BuCaYDFNZK77eSz14MYXqwO2HX+po9zP hTJrfmFXF519A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5A590677AF for ; Mon, 25 Aug 2025 10:27:54 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gmfh7csV_j8r for ; Mon, 25 Aug 2025 10:27:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756139273; bh=RZhQwQhd5NBkOW9ntwHpH6OYDuwPqWGmMiKVEvUE7Ug=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Bz5buoJXL82THbAeRbcNxzVTexL9wItUhBZjl9gt/JDV6d83ty5XPxIdMujTAESho HiFF6QktSxTE5E3uh8BjApWL0lqUeZcw5sefwLxlSulgzRo1KNVzkfZtc2mxm9NbiL zIDZhwIX83D70Xt5TuoC2ofvHJVsNH6Z9+7I5bnaX4dp2W32Kx3LA4rV49hgWi3gFL NBN3KHO7wz/eGZaUsCYi8n9x152YjO5PfbDtrKEIoDWXfTWqfauahwqSuL9jZtS7vX lh4SySRVxobmTjMt8FetRNvI9IhU0DASes0bPOMpPp+OQmq251UezXv5vrshuW5KLa cPccHY8xqdNZw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7453367792 for ; Mon, 25 Aug 2025 10:27:53 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756139268; bh=m3DDkv+RVLz3F5NpxRo+JdZo86UNciAU8etMLLMVZ4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pNFjMQHnvslVSJKC4+h/E8TK37slTqTrAIDXEcMqqFY32bAYMRMcklXULL7GdnfWH FQfyGeKT1BA6vt1jqv9XOJc6WGA+/d22sW6wRYom1YXGsUepVlzLI8F/HbNqLklR/h kWEw6nxReRIO6REKQH4oLzDHVBkLaKs0c1m/gCANnZJoQOLRPTU6InT6TJzIwocO4O gzrm2y/bazzLfzioEjNr/24nnPoz+UIaVSDhZjw0ppTymY3eIfwdHcqxZWfFs1E/CA vFTxjU5X5oefe136p2yaiIeqvkp3RbgSRHjN7tgfLAbhcs0rpCQxGkix3ZpwgCk2mE 7RkyWpKBX540A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E47E267795; Mon, 25 Aug 2025 10:27:48 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id m2cJJChk8adU; Mon, 25 Aug 2025 10:27:48 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756139265; bh=KKCp55lOe7ojv2mCq7LDZD05tbcaLXiexdi4LE9Sbek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rIpBJPn9Silbez3BuUOdC/AgjHGGQE0jAQtb9x8Y43ur0tMBsHPNxkzaRjX8AqvfY +T2nxAYxo3YC6L3gFJM06Yd4N6cn0fo4SOd/Cz4J750pzsB8SAquM9eVLKWz6YfWOr rKzkvVMO0a9fUxL26e6xDXZU9nQY90MK9hsfYzfmWrXJy+/skwhO2WjPKKSJHUk1UN oetu2pVI/fNIcJfL09YtGYc1yg5Yg9LqrMF/XZwuV1BUpyaQmYznC9exYIKqX1HKVU ceF+SK6RuyN3fhIoZgS5/FVLdEg614zSFDKtCN1QX8m7f1+3F1lpmAlOpOXD+HX5NZ WYz8/1DqWVqag== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 825B467787; Mon, 25 Aug 2025 10:27:45 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 25 Aug 2025 10:27:12 -0600 Message-ID: <20250825162727.3185381-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250825162727.3185381-1-sjg@u-boot.org> References: <20250825162727.3185381-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CQY5FI42RG5MBK7CSJPFZ4BHJWKR2PSY X-Message-ID-Hash: CQY5FI42RG5MBK7CSJPFZ4BHJWKR2PSY X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 09/16] cli: Avoid sending ANSI characters to a non-terminal List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Detect if there is no terminal present (this only works on sandbox) and skip sending ANSI characters when the CLI starts up. This avoids having them in logs, for example. Signed-off-by: Simon Glass --- (no changes since v1) common/cli.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/cli.c b/common/cli.c index 4694a35cd0e..23988330dd8 100644 --- a/common/cli.c +++ b/common/cli.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -337,6 +338,6 @@ void cli_init(void) hush_init_var(); #endif - if (CONFIG_IS_ENABLED(VIDEO_ANSI)) + if (CONFIG_IS_ENABLED(VIDEO_ANSI) && serial_is_tty()) printf(ANSI_CURSOR_SHOW "\n"); }