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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41811 in the body.
You can then email your comments to 41811 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#41811; Package guix. (Thu, 11 Jun 2020 17:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lars-Dominik Braun <lars <at> 6xq.net>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 11 Jun 2020 17:19:02 GMT) Full text and rfc822 format available.

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

From: Lars-Dominik Braun <lars <at> 6xq.net>
To: bug-guix <at> gnu.org
Subject: `guix search` shows control sequences
Date: Thu, 11 Jun 2020 19:18:38 +0200
Hi,

when using `guix search python2-xcffib` on a foreign distribution (Gentoo) not
all control sequences are stripped by the pager (see location and license):

---snip---
name: python2-xcffib
version: 0.6.0
outputs: out
systems: x86_64-linux i686-linux
dependencies: libxcb <at> 1.14 python2-cffi <at> 1.13.2 python2-six <at> 1.14.0
location: 8;;file://xxx/gnu/store/1ccswh99papcvkj028s9myy8kq26y26g-guix-module-union/share/guile/site/3.0/gnu/packages/python-xyz.scmgnu/packages/python-xyz.scm:5437:28;;
homepage: https://github.com/tych0/xcffib
license: 8;;http://directory.fsf.org/wiki/License:ExpatExpat8;;
synopsis: XCB Python bindings
description: Xcffib is a replacement for xpyb, an XCB Python bindings.
It adds support for Python 3 and PyPy.  It is based on cffi.
relevance: 20
---

`guix search python2-xcffib | less` works fine, `unset`ting the environment
variable $LESS or setting it to 'FrX' (i.e. what guix does when it’s missing)
fixes the issue too, so I’m a little puzzled. Some more information:

---snip---
$ env | grep -i less
LESS=-R -M --shift 5
LESSOPEN=|lesspipe %s
PAGER=/usr/bin/less
$ less --version
less 551 (PCRE2 regular expressions)
[…]
$ LANG=C guix describe
Generation 15	Jun 11 2020 17:47:13	(current)
  guix cbd9581
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: cbd9581acc41cd49eb81c2432452cad4de805cbd
---snap---

Cheers,
Lars





Information forwarded to bug-guix <at> gnu.org:
bug#41811; Package guix. (Sat, 13 Jun 2020 20:55:01 GMT) Full text and rfc822 format available.

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")))))

Information forwarded to bug-guix <at> gnu.org:
bug#41811; Package guix. (Sun, 14 Jun 2020 06:10:02 GMT) Full text and rfc822 format available.

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

From: Lars-Dominik Braun <lars <at> 6xq.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 41811 <at> debbugs.gnu.org
Subject: Re: bug#41811: `guix search` shows control sequences
Date: Sun, 14 Jun 2020 08:09:25 +0200
Hi,

> No control sequences if you do “unset LESS” before hand, right?
> I think we’ll just override ‘LESS’ unconditionally as shown below.
yes, and the patch fixes the issue.

Thanks,
Lars





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 14 Jun 2020 13:47:02 GMT) Full text and rfc822 format available.

Notification sent to Lars-Dominik Braun <lars <at> 6xq.net>:
bug acknowledged by developer. (Sun, 14 Jun 2020 13:47:02 GMT) Full text and rfc822 format available.

Message #16 received at 41811-done <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-done <at> debbugs.gnu.org
Subject: Re: bug#41811: `guix search` shows control sequences
Date: Sun, 14 Jun 2020 15:46:48 +0200
Hi,

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

>> No control sequences if you do “unset LESS” before hand, right?
>> I think we’ll just override ‘LESS’ unconditionally as shown below.
> yes, and the patch fixes the issue.

Pushed as e66f243e929bbd94e62e77cfa6a63dfd001ebe07.
Thanks for testing!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 13 Jul 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 287 days ago.

Previous Next


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