From b0a6a9713076347c14ee2dd0ea494ab086df2a82 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 15 Apr 2016 00:10:22 +0200 Subject: substitute: Honor the number of columns of the client terminal. * guix/store.scm (set-build-options): Add #:terminal-columns parameter and honor it. * guix/scripts/substitute.scm (client-terminal-columns): New procedure. (guix-substitute): Use it to parameterize 'current-terminal-columns'. --- guix/store.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'guix/store.scm') diff --git a/guix/store.scm b/guix/store.scm index 906611658e..af311a0ebd 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -22,6 +22,7 @@ (define-module (guix store) #:use-module (guix serialization) #:use-module (guix monads) #:autoload (guix base32) (bytevector->base32-string) + #:autoload (guix build syscalls) (terminal-columns) #:use-module (rnrs bytevectors) #:use-module (rnrs io ports) #:use-module (srfi srfi-1) @@ -530,7 +531,10 @@ (define* (set-build-options server ;; the daemon's settings are used. Otherwise, it ;; overrides the daemons settings; see 'guix ;; substitute'. - (substitute-urls #f)) + (substitute-urls #f) + + ;; Number of columns in the client's terminal. + (terminal-columns (terminal-columns))) ;; Must be called after `open-connection'. (define socket @@ -565,6 +569,10 @@ (define socket ,@(if rounds `(("build-repeat" . ,(number->string (max 0 (1- rounds))))) + '()) + ,@(if terminal-columns + `(("terminal-columns" + . ,(number->string terminal-columns))) '())))) (send (string-pairs pairs)))) (let loop ((done? (process-stderr server))) -- cgit v1.2.3