GNU bug report logs - #41811
`guix search` shows control sequences

Previous Next

Package: guix;

Reported by: Lars-Dominik Braun <lars <at> 6xq.net>

Date: Thu, 11 Jun 2020 17:19:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 41811 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Lars-Dominik Braun <lars <at> 6xq.net>
Cc: 41811 <at> debbugs.gnu.org
Subject: Re: bug#41811: `guix search` shows control sequences
Date: Sat, 13 Jun 2020 22:54:08 +0200
[Message part 1 (text/plain, inline)]
Hi,

Lars-Dominik Braun <lars <at> 6xq.net> skribis:

> $ env | grep -i less
> LESS=-R -M --shift 5
> LESSOPEN=|lesspipe %s
> PAGER=/usr/bin/less
> $ less --version
> less 551 (PCRE2 regular expressions)
> […]

No control sequences if you do “unset LESS” before hand, right?

I think we’ll just override ‘LESS’ unconditionally as shown below.

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/guix/ui.scm b/guix/ui.scm
index 98b30445c8..2595e44062 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1563,8 +1563,7 @@ zero means that PACKAGE does not match any of REGEXPS."
       ;; Set 'LESS' so that 'less' exits if everything fits on the screen (F),
       ;; lets ANSI escapes through (r), does not send the termcap
       ;; initialization string (X).
-      (let ((pager (with-environment-variables `(("LESS"
-                                                  ,(or (getenv "LESS") "FrX")))
+      (let ((pager (with-environment-variables `(("LESS" "FrX"))
                      (open-pipe* OPEN_WRITE
                                  (or (getenv "GUIX_PAGER") (getenv "PAGER")
                                      "less")))))

This bug report was last modified 4 years and 339 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.