void-packages/srcpkgs/perl/patches/perldoc-less-R.diff

31 lines
1.2 KiB
Diff
Raw Normal View History

From 6ec80ea3574a990f02aebbeed5cf051b96cb939d 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
--- cpan/Pod-Perldoc/lib/Pod/Perldoc.pm
+++ 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;
}
}