aboutsummaryrefslogtreecommitdiff
path: root/guix/progress.scm
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2023-11-11 11:02:07 +0100
committerJulien Lepiller <julien@lepiller.eu>2023-11-11 11:07:47 +0100
commit28ca80717da67f90a3b33491e9807a053cf09c2d (patch)
treefd9daba03d27b8b406f68f9dfd58ce75c0eb1f73 /guix/progress.scm
parentfd11d7fbf8e0fcc61ff764dcc0ab737971afc55a (diff)
downloadguix-28ca80717da67f90a3b33491e9807a053cf09c2d.tar
guix-28ca80717da67f90a3b33491e9807a053cf09c2d.tar.gz
guix: Properly compute progress bar width.
* guix/progress.scm (progress-reporter/bar): Take font width into account to compute progress bar width. * guix/git.scm (show-progress): Take font width into account to compute progress bar width. Change-Id: I946e447c1ea7c6eb4ff805400280f39e8f1a7c02
Diffstat (limited to 'guix/progress.scm')
-rw-r--r--guix/progress.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/guix/progress.scm b/guix/progress.scm
index 33cf6f4a1a..13d3ddc171 100644
--- a/guix/progress.scm
+++ b/guix/progress.scm
@@ -21,6 +21,8 @@
(define-module (guix progress)
#:use-module (guix records)
+ #:use-module ((guix build syscalls)
+ #:select (terminal-string-width))
#:use-module (srfi srfi-19)
#:use-module (rnrs io ports)
#:use-module (rnrs bytevectors)
@@ -307,7 +309,7 @@ tasks is performed. Write PREFIX at the beginning of the line."
(if (string-null? prefix)
(display (progress-bar ratio (current-terminal-columns)) port)
(let ((width (- (current-terminal-columns)
- (string-length prefix) 3)))
+ (terminal-string-width prefix) 3)))
(display prefix port)
(display " " port)
(display (progress-bar ratio width) port)))