From 5b6e31b020678dbbc289479b8ff1853c3fbd2085 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 9 Feb 2022 22:23:27 +0100 Subject: 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'. --- guix/ui.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'guix/ui.scm') diff --git a/guix/ui.scm b/guix/ui.scm index d1f92ce7be..238952723e 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -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 -- cgit v1.2.3