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'.
parent
7ffcee1937
commit
5b6e31b020
|
@ -1900,7 +1900,9 @@ DURATION-RELATION with the current time."
|
||||||
(link (if (supports-hyperlinks?)
|
(link (if (supports-hyperlinks?)
|
||||||
(cut file-hyperlink file <>)
|
(cut file-hyperlink file <>)
|
||||||
identity))
|
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
|
number
|
||||||
(date->string
|
(date->string
|
||||||
(time-utc->date
|
(time-utc->date
|
||||||
|
|
Reference in New Issue