From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 2N1ZLFqwCGQgtgAASxT56A (envelope-from ) for ; Wed, 08 Mar 2023 16:57:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id gER0K1qwCGSoXgEAG6o9tA (envelope-from ) for ; Wed, 08 Mar 2023 16:57:14 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7BAF11FEBB for ; Wed, 8 Mar 2023 16:57:14 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678291034; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=JGMF7lPMfatea0cEi3OulJAcj7sK4cCcYaTF8nhdquc=; b=qhiH8qrTZEDw9hK3sjuTjZe8wfYFatuuD3OCQHC5PtSCTwcGlCv55nxipwJdxMAvnVyf5E vofSExmpvvm/vzwwDwtGZagaNcXFdeNmyhw7nu8Jw8+YBBjepukdRu/Iv7jkFLs4CvUzZi 5YnE9PraXaanzdgtM1t4/8+0H8IRQn/64zjrwjx1uhlqjjsFzLzpg4PXDjmUDwS3mbPrED 7GPvNaq3AjthwElye8D7QRsadwIXb9e623Vq4yyWt7Y8FYW6xIkvHe/zr5+EUF87oYpLax dMhwVO8NoUuU/2z5pH5tpXnitUsNHPbsGBY90s7WSa3rb2OJqFPf1wQCPktodQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678291034; a=rsa-sha256; cv=none; b=XROwqMP4dlKdJH6wx2s6+//KfF/42Re/tsLY7y4ZYdM6KGvnsU7SyS0MiZsCPgMot6jyUv iUV1nmszSmQc/PYJ9NWoa3ae6xUl1bWo2B9AAJemw92L5dD9WjyMvhvzu3XChvsoDHg9QF 4PrS0sA0hkvfxyPRp48TwbcOR1EFhoAcVGdaBHHImC+h5Y33k/huKxqdH5qH9+5pVyn1GP KQmZFGeFEEqLjpVqA/7I3GAXSPynDtpttqx4JUozILu9gDZMyaIlfB21lnx18ACscHN58b j4heqa7aYMc8AggR0VBHXiKYy5IQpWGfTqUouKcw34UYVJq3Gl1WLBH2OhdQ2Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZwA4-0005WJ-Vd; Wed, 08 Mar 2023 10:57:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZwA2-0005W4-Iv for guix-patches@gnu.org; Wed, 08 Mar 2023 10:57:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZwA2-00025d-AT for guix-patches@gnu.org; Wed, 08 Mar 2023 10:57:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZwA2-0008Oa-66 for guix-patches@gnu.org; Wed, 08 Mar 2023 10:57:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#62056] [PATCH] guix: Only issue erase-current-line sequence for ttys. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 08 Mar 2023 15:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62056 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62056@debbugs.gnu.org Cc: Bruno Victal X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167829098832227 (code B ref -1); Wed, 08 Mar 2023 15:57:01 +0000 Received: (at submit) by debbugs.gnu.org; 8 Mar 2023 15:56:28 +0000 Received: from localhost ([127.0.0.1]:50001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZw9T-0008Ni-Pa for submit@debbugs.gnu.org; Wed, 08 Mar 2023 10:56:28 -0500 Received: from lists.gnu.org ([209.51.188.17]:34510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZw9S-0008Na-40 for submit@debbugs.gnu.org; Wed, 08 Mar 2023 10:56:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZw9R-0005UF-QG for guix-patches@gnu.org; Wed, 08 Mar 2023 10:56:25 -0500 Received: from smtpm5.myservices.hosting ([185.26.105.236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZw9P-0001mk-B9 for guix-patches@gnu.org; Wed, 08 Mar 2023 10:56:25 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm5.myservices.hosting (Postfix) with ESMTP id B269020CB7 for ; Wed, 8 Mar 2023 16:56:07 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 5D5E8800A4; Wed, 8 Mar 2023 16:56:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 5MDkHJYR6CN5; Wed, 8 Mar 2023 16:56:04 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 13C5B8009E; Wed, 8 Mar 2023 16:56:04 +0100 (CET) From: Bruno Victal Date: Wed, 8 Mar 2023 15:55:56 +0000 Message-Id: <6a78ee837fe579d6b1beaeda54beddba3c05fd2e.1678290800.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.26.105.236; envelope-from=mirai@makinata.eu; helo=smtpm5.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: X-Migadu-Scanner: scn0.migadu.com X-Migadu-Queue-Id: 7BAF11FEBB X-Spam-Score: -3.20 X-Migadu-Spam-Score: -3.20 List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-TUID: FoO+zcJepuF8 * guix/progress.scm (erase-current-line): Only issue erase-current-line sequence for ttys. --- Avoids cluttering log lines with �[K when output is logged to a file. guix/progress.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/guix/progress.scm b/guix/progress.scm index 33cf6f4a1a..a1cdd25557 100644 --- a/guix/progress.scm +++ b/guix/progress.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015 Steve Sprang ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2018 Clément Lassieur +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -209,9 +210,12 @@ (define* (progress-bar % #:optional (bar-width 20)) (string (progress-bar-style-stop bar-style))))) (define (erase-current-line port) - "Write an ANSI erase-current-line sequence to PORT to erase the whole line and -move the cursor to the beginning of the line." - (display "\r\x1b[K" port)) + "When @var{port} is interactive, write an ANSI erase-current-line sequence +to erase the whole line and move the cursor to the beginning of the line, +otherwise write a newline." + (if (isatty? port) + (display "\r\x1b[K" port) + (newline port))) (define* (display-download-progress file size #:key base-commit: 85d4e8af5baf9b0a9cadf95d802674d0254433da -- 2.39.1