From unknown Thu Aug 21 12:11:52 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#62056 <62056@debbugs.gnu.org> To: bug#62056 <62056@debbugs.gnu.org> Subject: Status: [PATCH] guix: Only issue erase-current-line sequence for ttys. Reply-To: bug#62056 <62056@debbugs.gnu.org> Date: Thu, 21 Aug 2025 19:11:52 +0000 retitle 62056 [PATCH] guix: Only issue erase-current-line sequence for ttys. reassign 62056 guix-patches submitter 62056 Bruno Victal severity 62056 normal tag 62056 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 08 10:56:28 2023 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 To: guix-patches@gnu.org Subject: [PATCH] guix: Only issue erase-current-line sequence for ttys. 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-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 16 17:30:19 2023 Received: (at 62056) by debbugs.gnu.org; 16 Mar 2023 21:30:19 +0000 Received: from localhost ([127.0.0.1]:43220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcvAw-00079J-R3 for submit@debbugs.gnu.org; Thu, 16 Mar 2023 17:30:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcvAv-000794-7U for 62056@debbugs.gnu.org; Thu, 16 Mar 2023 17:30:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcvAp-0000hh-FZ; Thu, 16 Mar 2023 17:30:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=njsiV8XOvVzCfV4gD5oyzlPAERY60yuyAAuQ8ajIPWc=; b=i9toqJQN9Vp+devztrlg PrOOSvePw91S0i54TNY+RZeTpT93hQrhEeciCmjS8PrzCRyybgfBlaP7QHjQOrd0RZax64F2KFux7 nwq42q1dT3URgTHLCIKnQE6ABfNuGdVsu8NqWUmw4oVV1zrEq+v+Dyr3QdMx/pnAvFjyzSOR6sqWc lafcbd5jP11gfQfxizGnVEsFdVCOcq71lBxVN9n8kCq00AqGSnOZAlP1BqceFcA1jGNUxLze1kTYc bA4ameTtP9YVd6sERXGGG4Ng4ie5Ea2arZtN3UNLOvu2h7AblhZy6LuQ3GZcoc2CtsUjbcX3KJ5pC AV9la0qBlj5KCA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcvAo-0001DH-12; Thu, 16 Mar 2023 17:30:10 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Bruno Victal Subject: Re: bug#62056: [PATCH] guix: Only issue erase-current-line sequence for ttys. References: <6a78ee837fe579d6b1beaeda54beddba3c05fd2e.1678290800.git.mirai@makinata.eu> Date: Thu, 16 Mar 2023 22:30:06 +0100 In-Reply-To: <6a78ee837fe579d6b1beaeda54beddba3c05fd2e.1678290800.git.mirai@makinata.eu> (Bruno Victal's message of "Wed, 8 Mar 2023 15:55:56 +0000") Message-ID: <874jqkbd0h.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62056 Cc: 62056@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Bruno Victal skribis: > * guix/progress.scm (erase-current-line): Only issue erase-current-line s= equence for ttys. > --- > > Avoids cluttering log lines with =EF=BF=BD[K when output is logged to a f= ile. +1! > (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 sequ= ence > +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))) We should avoid calling =E2=80=98isatty?=E2=80=99 every time, it=E2=80=99s = too costly, which is why there=E2=80=99s also =E2=80=98isatty?*=E2=80=99 somewhere that memoizes= things. However, it seems up to the caller to check that before calling =E2=80=98erase-current-line=E2=80=99. That seems to be the case within pro= gress.scm and in (guix status). Could you see which use of =E2=80=98erase-current-line=E2=80=99 is causing = problems? TIA, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 18 07:44:39 2023 Received: (at 62056) by debbugs.gnu.org; 18 Mar 2023 11:44:39 +0000 Received: from localhost ([127.0.0.1]:46453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdUzH-0006gg-1m for submit@debbugs.gnu.org; Sat, 18 Mar 2023 07:44:39 -0400 Received: from smtpm4.myservices.hosting ([185.26.105.235]:55646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdUzF-0006gX-Bl for 62056@debbugs.gnu.org; Sat, 18 Mar 2023 07:44:38 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id EE33820BF0; Sat, 18 Mar 2023 12:44:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 795788009A; Sat, 18 Mar 2023 12:27:21 +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 3-SRC-LaPyqj; Sat, 18 Mar 2023 12:27:20 +0100 (CET) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id ABFF580098; Sat, 18 Mar 2023 12:27:20 +0100 (CET) Message-ID: <99afbc21-920c-1867-e368-d541ae524283@makinata.eu> Date: Sat, 18 Mar 2023 11:27:12 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: bug#62056: [PATCH] guix: Only issue erase-current-line sequence for ttys. Content-Language: en-US To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= References: <6a78ee837fe579d6b1beaeda54beddba3c05fd2e.1678290800.git.mirai@makinata.eu> <874jqkbd0h.fsf@gnu.org> From: Bruno Victal In-Reply-To: <874jqkbd0h.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 62056 Cc: 62056@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Hi Ludo’, On 2023-03-16 21:30, Ludovic Courtès wrote: > Bruno Victal skribis: >> (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))) > > We should avoid calling ‘isatty?’ every time, it’s too costly, which is > why there’s also ‘isatty?*’ somewhere that memoizes things. > > However, it seems up to the caller to check that before calling > ‘erase-current-line’. That seems to be the case within progress.scm and > in (guix status). guix/status.scm:471 defines a erase-current-line* which calls isatty?*. Does this mean that erase-current-line has to be “wrapped” every time we want it to have tty awareness? If that's not the case, perhaps we could change the signature of erase-current-line to: (define* (erase-current-line port #:optional tty?) > Could you see which use of ‘erase-current-line’ is causing problems? guix/scripts/substitute.scm:318 Cheers, Bruno From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 18 16:02:12 2023 Received: (at 62056) by debbugs.gnu.org; 18 Apr 2023 20:02:12 +0000 Received: from localhost ([127.0.0.1]:60432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1porWm-0005rT-Ga for submit@debbugs.gnu.org; Tue, 18 Apr 2023 16:02:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1porWl-0005rG-2z for 62056@debbugs.gnu.org; Tue, 18 Apr 2023 16:02:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1porWe-00026c-MW; Tue, 18 Apr 2023 16:02:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=1X/EAdgNe70Wd8WqOhqGkm2FNJhcEHqTimqJFZvjCdM=; b=Pk7YO1iLFYgOURO+B4gL b6B+hcA+2Zf8jfl3OskFHoezCIWS0KTRUylYEzKlwkJo/YbR+8kyxvgOgpROm6gdK3MiqKFCt1Hie 0yQeI6ucleK/NH5Hjmp37LwpY22CocB4VryqONytt3vW+QWefXA4Hla0W/uo1yyNq6lBiG0Op33Mc XVOuE3xQW/br0WMrem3EDs79jlaF+NOHYKmzFLE3XOu9KrLgDD1rf3v4m8pC/K7z3Bd5NdhZV+Es/ IJEYZg8nV+kklUZZKzKZx1SF7WT8qUAcWthJ3ZGIFoA1xNsh9GkG9TzUvp0FEJd/sDd65Bim9oNtQ oRRDkLiJ1duvjg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1porWd-0008Ps-Ir; Tue, 18 Apr 2023 16:02:04 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Bruno Victal Subject: Re: bug#62056: [PATCH] guix: Only issue erase-current-line sequence for ttys. References: <6a78ee837fe579d6b1beaeda54beddba3c05fd2e.1678290800.git.mirai@makinata.eu> <874jqkbd0h.fsf@gnu.org> <99afbc21-920c-1867-e368-d541ae524283@makinata.eu> Date: Tue, 18 Apr 2023 22:02:00 +0200 In-Reply-To: <99afbc21-920c-1867-e368-d541ae524283@makinata.eu> (Bruno Victal's message of "Sat, 18 Mar 2023 11:27:12 +0000") Message-ID: <877cu9hscn.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62056 Cc: 62056@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Bruno, Bruno Victal skribis: > On 2023-03-16 21:30, Ludovic Court=C3=A8s wrote: >> Bruno Victal skribis: >>> (define (erase-current-line port) >>> - "Write an ANSI erase-current-line sequence to PORT to erase the whol= e 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 se= quence >>> +to erase the whole line and move the cursor to the beginning of the li= ne, >>> +otherwise write a newline." >>> + (if (isatty? port) >>> + (display "\r\x1b[K" port) >>> + (newline port))) >>=20 >> We should avoid calling =E2=80=98isatty?=E2=80=99 every time, it=E2=80= =99s too costly, which is >> why there=E2=80=99s also =E2=80=98isatty?*=E2=80=99 somewhere that memoi= zes things. >>=20 >> However, it seems up to the caller to check that before calling >> =E2=80=98erase-current-line=E2=80=99. That seems to be the case within = progress.scm and >> in (guix status). > > guix/status.scm:471 defines a erase-current-line* which calls isatty?*. > Does this mean that erase-current-line has to be =E2=80=9Cwrapped=E2=80= =9D every time > we want it to have tty awareness? =E2=80=98erase-current-line=E2=80=99 is low-level and often the caller has = already done an =E2=80=98isatty?=E2=80=99 check before calling it (for instance in progr= ess bars). I think that=E2=80=99s the reason it doesn=E2=80=99t include that check. > If that's not the case, perhaps we could change the signature of erase-cu= rrent-line to: > (define* (erase-current-line port #:optional tty?) I don=E2=80=99t think so. >> Could you see which use of =E2=80=98erase-current-line=E2=80=99 is causi= ng problems? > > guix/scripts/substitute.scm:318 In this particular case, how about returning a different depending on =E2=80=98isatty?=E2=80=99? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun May 28 05:54:43 2023 Received: (at 62056) by debbugs.gnu.org; 28 May 2023 09:54:43 +0000 Received: from localhost ([127.0.0.1]:53320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3D6o-0001wf-Qy for submit@debbugs.gnu.org; Sun, 28 May 2023 05:54:43 -0400 Received: from smtpm4.myservices.hosting ([185.26.105.235]:38524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3D6m-0001wX-FR for 62056@debbugs.gnu.org; Sun, 28 May 2023 05:54:41 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id 6DE7F20BCE; Sun, 28 May 2023 11:54:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id AB43C80097; Sun, 28 May 2023 11:54:37 +0200 (CEST) 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 BJxYr9BNnXmg; Sun, 28 May 2023 11:54:37 +0200 (CEST) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 3C5D180060; Sun, 28 May 2023 11:54:37 +0200 (CEST) Message-ID: <7e2399a1-e073-cf11-612d-b130ec71fa54@makinata.eu> Date: Sun, 28 May 2023 10:54:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: bug#62056: [PATCH] guix: Only issue erase-current-line sequence for ttys. Content-Language: en-US To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= References: <6a78ee837fe579d6b1beaeda54beddba3c05fd2e.1678290800.git.mirai@makinata.eu> <874jqkbd0h.fsf@gnu.org> <99afbc21-920c-1867-e368-d541ae524283@makinata.eu> <877cu9hscn.fsf_-_@gnu.org> From: Bruno Victal In-Reply-To: <877cu9hscn.fsf_-_@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 62056 Cc: 62056@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Hi Ludo’, On 2023-04-18 21:02, Ludovic Courtès wrote: > Bruno Victal skribis: >> On 2023-03-16 21:30, Ludovic Courtès wrote: >>> Could you see which use of ‘erase-current-line’ is causing problems? >> >> guix/scripts/substitute.scm:318 > > In this particular case, how about returning a different > depending on ‘isatty?’? It looks like the problem was not just at that particular line, rather anywhere that happens to call (erase-current-line …) which in addition to guix/scripts/substitute.scm are guix/status.scm and guix/progress.scm. Perhaps every instance of under guix/ should be checking whether or not they are running under a tty? WDYT? -- Furthermore, I consider that nonfree software must be eradicated. Cheers, Bruno. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 02 16:19:29 2024 Received: (at 62056) by debbugs.gnu.org; 2 Jun 2024 20:19:29 +0000 Received: from localhost ([127.0.0.1]:37092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDrfs-0002ny-Og for submit@debbugs.gnu.org; Sun, 02 Jun 2024 16:19:29 -0400 Received: from mail-108-mta196.mxroute.com ([136.175.108.196]:43721) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDrfq-0002no-7P for 62056@debbugs.gnu.org; Sun, 02 Jun 2024 16:19:27 -0400 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta196.mxroute.com (ZoneMTA) with ESMTPSA id 18fda9b1bb8000e2b6.001 for <62056@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 02 Jun 2024 20:19:09 +0000 X-Zone-Loop: 8bc7844884d3ff1559633cb122399dec982b4b065a26 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=F2ILo9toFSCuKWFPTR8fW7+vxRaknJjmXwROBs7lI8s=; b=OYrUYS8efp3sZW31X6mlANyE4G r5GRNeq0kBIT62gAX/5B9+JAKrjWVVgtkVnjkDibMMXM32Gne9+ReN+NibaR5YD/Pmj4zYtfwjJ5p vHteFfK41heStnmedxx3p/K45XEh3IqZsbYA8icvq9/nwrx/N8xvxyZ5c6vhQnzW8/Bj6di37p1JG HCAt5j/344WuiFbnOMYPBhA6Y5DRsyIjYmTiquPaZzD3o4fJFqvCzCrLG/Or9U3Ny1rL4JJLQT3v8 NZ3vo4W93FBPwlCQdbrwgKqeQ5Su0zBSRK+g55vp3qHfJiXRV/V/QBT4O4zO8fACjsM85//xw48zH aqmcESOw==; From: Richard Sent To: 62056@debbugs.gnu.org Subject: Custom progress reporter for scripts/substitute.scm Date: Sun, 02 Jun 2024 16:19:02 -0400 Message-ID: <87bk4jdrnt.fsf@freakingpenguin.com> MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: richard@freakingpenguin.com X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62056 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) I started investigating this issue for the substitutes script specifically and it's more challenging than a straightforward isatty? call. I opened an issue for that here: https://issues.guix.gnu.org/71299 I agree that modifying erase-current-line isn't the right solution. I think it's the responsibility of the caller to ensure that the output port is appropriate. -- Take it easy, Richard Sent Making my computer weirder one commit at a time.