From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#33470: [bug#34249] [PATCH] guix package: Avoid spinner at end of output. Date: Tue, 29 Jan 2019 23:46:03 +0100 Message-ID: <8736pbm6ac.fsf@gnu.org> References: <20190129195031.21496-1-mail@cbaines.net> <20190129211645.08cdbd2d@scratchpost.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:40900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goc9x-0005Rz-Gy for bug-guix@gnu.org; Tue, 29 Jan 2019 17:47:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goc9v-0003OY-Ft for bug-guix@gnu.org; Tue, 29 Jan 2019 17:47:13 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51664) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1goc9o-0003J0-2Q for bug-guix@gnu.org; Tue, 29 Jan 2019 17:47:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1goc9m-0002n3-1u for bug-guix@gnu.org; Tue, 29 Jan 2019 17:47:03 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20190129211645.08cdbd2d@scratchpost.org> (Danny Milosavljevic's message of "Tue, 29 Jan 2019 21:16:45 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Danny Milosavljevic Cc: 33470@debbugs.gnu.org, 34249@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Danny Milosavljevic skribis: > Hi Christopher, >> diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm >> index a633d2ee6d..4db0e72e9b 100644 >> --- a/guix/scripts/package.scm >> +++ b/guix/scripts/package.scm >> @@ -159,6 +159,7 @@ hooks\" run when building the profile." >> (switch-symlinks profile (basename name)) >> (unless (string=3D? profile %current-profile) >> (register-gc-root store name)) >> + (display "\r") ; erase the spinner > > In order to actually erase it, might want to do (display "\r\x1b[K") inst= ead. And to do that, you can use (erase-current-line port). Though actually I think this should be done in =E2=80=98print-build-event= =E2=80=99 in (guix status). Probably something like the patch below, but I haven=E2=80= =99t been able to quickly reproduce the initial problem. Could you give it a spin (ah ha!) and report back? If it doesn=E2=80=99t solve the issue, we should strace the thing to see wh= y it keeps spinning after everything is =E2=80=9Cdone=E2=80=9D basically. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/status.scm b/guix/status.scm index e3375816c5..7a330525b0 100644 --- a/guix/status.scm +++ b/guix/status.scm @@ -465,8 +465,14 @@ addition to build events." (_ (spin! port)))))) - (unless print-log? - (display "\r" port)) ;erase the spinner + (define erase-current-line* + (if (isatty?* port) + (lambda (port) + (erase-current-line port) + (force-output port)) + (const #t))) + + (erase-current-line* port) ;clear the spinner (match event (('build-started drv . _) (let ((properties (derivation-properties --=-=-=--