~ruther/guix-local

5b6e31b020678dbbc289479b8ff1853c3fbd2085 — Ludovic Courtès 4 years ago 7ffcee1
ui: 'display-generation' uses color when talking to a pager.

This makes sure that, say, 'guix pull -l' benefits from colors when its
output is piped to a pager, as long as the underlying terminal supports
it.

* guix/ui.scm (display-generation): Add second argument to 'highlight'.
1 files changed, 3 insertions(+), 1 deletions(-)

M guix/ui.scm
M guix/ui.scm => guix/ui.scm +3 -1
@@ 1900,7 1900,9 @@ DURATION-RELATION with the current time."
           (link   (if (supports-hyperlinks?)
                       (cut file-hyperlink file <>)
                       identity))
           (header (format #f (link (highlight (G_ "Generation ~a\t~a")))
           (header (format #f (link (highlight (G_ "Generation ~a\t~a")
                                               (or (pager-wrapped-port)
                                                   (current-output-port))))
                           number
                           (date->string
                            (time-utc->date