Subject: | 'perldoc -oman' is incorrectly rendered under Cygwin. |
This ticket was originally reported in perlbug. <http://rt.perl.org/rt3/Ticket/Display.html?id=31997> The following is from that ticket. My comments there follow. A patch is also attached.
'perldoc -oman' is incorrectly rendered under Cygwin.
I tried with the following terminals: cygwin, xterm, rxvt.
The problem is that the nroff output is piped to the default
pager which is not defined for cygwin.
Under cygwin the default render for man is
"/usr/bin/less -isrR" (see -P option for man man)
See sub pagers_guessing in module Pod::Perldoc.
Workaround:
under the shell, define PERLDOC_PAGER="less -isrR"
What to do do solve this bug?
Add this block to Perldoc.pm, sub pagers_guessing
elsif (IS_Cygwin) {
push @pagers, '/usr/bin/less -isrR';
}
Olivier Mengué.
My comments...
I could not get your change to work because the pager "/usr/bin/less" is
first in the @pagers array and used. I did, however, get it to work
with "unshift @pagers, '/usr/bin/less -isrR';" It does make nice, easy
to read perldoc's on Cygwin, so it'd be great to get this in. A patch
is included.
Steve Peters
--- Perldoc.pm.orig 2004-10-19 08:52:58.635955200 -0500
+++ Perldoc.pm 2004-10-19 09:09:24.183102400 -0500
@@ -1225,6 +1225,10 @@
push @pagers, qw( less.exe more.com< );
unshift @pagers, $ENV{PAGER} if $ENV{PAGER};
}
+ elsif (IS_Cygwin) {
+ unshift @pagers, '/usr/bin/less -isrR';
+ unshift @pagers, $ENV{PAGER} if $ENV{PAGER};
+ }
else {
if (IS_OS2) {
unshift @pagers, 'less', 'cmd /c more <';