From dc64aadd9b124df37fcdf2f6dc057b61cf05a473 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 15 Nov 2020 20:36:32 +0100 Subject: [PATCH] ui: Ignore empty $PAGER variables. * guix/ui.scm (call-with-paginated-output-port): Treat "" as unset. --- guix/ui.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guix/ui.scm b/guix/ui.scm index 66614eef7c..584afc65dd 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1673,8 +1673,11 @@ zero means that PACKAGE does not match any of REGEXPS." ;; instead of 'r': this strips hyperlinks but allows 'less' to make a ;; good estimate of the line length. (let ((pager (with-environment-variables `(("LESS" ,less-options)) - (open-pipe (or (getenv "GUIX_PAGER") (getenv "PAGER") - "less") + ;; Ignore environment variables set to "" as if unset. + (open-pipe (find (lambda (s) (and s (not (string=? "" s)))) + (list (getenv "GUIX_PAGER") + (getenv "PAGER") + "less")) OPEN_WRITE)))) (dynamic-wind (const #t) -- 2.29.2