Skip Menu |

This queue is for tickets about the Pod-Perldoc CPAN distribution.

Report information
The Basics
Id: 98636
Status: resolved
Priority: 0/
Queue: Pod-Perldoc

People
Owner: Nobody in particular
Requestors: ntyni [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 3.23
Fixed in: (no value)



Subject: ToTerm escape sequences visible in 'less'
Hi, the switch to the ToTerm backend made perldoc output contain visible escape sequences when viewed with the "less" pager. Apparently "less" needs to be explicitly instructed to let those through, with the "-r" or "-R" option. This is https://bugs.debian.org/758689 and we've applied the attached patch for now. It doesn't help people with a LESS setting in a lesskey file, but I don't see a way around that. Thanks for your work, -- Niko Tyni ntyni@debian.org
Subject: perldoc-less-R.diff
From 5b9faf7d26bb49541738adc8f0e25a52a8f590ea Mon Sep 17 00:00:00 2001 From: Niko Tyni <ntyni@debian.org> Date: Sat, 23 Aug 2014 18:46:43 -0700 Subject: Tell the 'less' pager to allow terminal escape sequences The 'ToTerm' backend generates terminal escape sequences that the 'less' pager does not display by default. The "-R" option controls this, so pass it in the LESS environment variable to avoid disturbing other pager invocations. Bug-Debian: https://bugs.debian.org/758689 Patch-Name: debian/perldoc-less-R.diff --- cpan/Pod-Perldoc/lib/Pod/Perldoc.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm b/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm index 6ddd21d..1089f5b 100644 --- a/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm +++ b/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm @@ -1892,6 +1892,9 @@ sub page { # apply a pager to the output file if ($self->is_vms) { last if system("$pager $output") == 0; } else { + # fix visible escape codes in ToTerm output + # https://bugs.debian.org/758689 + local $ENV{LESS} = defined $ENV{LESS} ? "$ENV{LESS} -R" : "-R"; last if system("$pager \"$output\"") == 0; } }
On Fri Sep 05 05:58:44 2014, ntyni@iki.fi wrote: Show quoted text
> Hi, the switch to the ToTerm backend made perldoc output contain > visible escape sequences when viewed with the "less" pager. Apparently > "less" needs to be explicitly instructed to let those through, with > the "-r" or "-R" option.
Thanks very much for the patch. I will get it applied in a future release. (I have another pending patch as a github pull request about file encoding that I plan to get to soon.) I am aware of the issue (https://rt.cpan.org/Ticket/Display.html?id=88204) but hadn't really thought about how to handle it. I am still interested in doing something more "elegant" but what that might be right now, I'm not sure. Mark
On Fri Sep 05 05:58:44 2014, ntyni@iki.fi wrote: Show quoted text
> This is https://bugs.debian.org/758689 and we've applied the attached > patch for now. It doesn't help people with a LESS setting in a lesskey > file, but I don't see a way around that.
Thanks again for your patch. Applied as 9a92147e2d9d6e815d2846b86f4c025addab9dff. Also on CPAN as 3.24_01. Please try it out and let me know! Thanks.