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;
}
}