From 7473bce207af846312d5167a398f5f20bbf3e896 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 4 Feb 2019 11:27:24 +0100 Subject: status: Erase the progress bar or spinner. Previously the progress bar wouldn't be erased by the time the next "building foo" line would be printed. * guix/status.scm (print-build-event)[erase-current-line*]: New procedure. Call it instead of (display "\r"). --- guix/status.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'guix/status.scm') diff --git a/guix/status.scm b/guix/status.scm index e3375816c5..bd382baf7a 100644 --- a/guix/status.scm +++ b/guix/status.scm @@ -465,8 +465,15 @@ addition to build events." (_ (spin! port)))))) + (define erase-current-line* + (if (isatty?* port) + (lambda (port) + (erase-current-line port) + (force-output port)) + (const #t))) + (unless print-log? - (display "\r" port)) ;erase the spinner + (erase-current-line* port)) ;clear the spinner or progress bar (match event (('build-started drv . _) (let ((properties (derivation-properties -- cgit v1.2.3