Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#35 improved pager support in PDL shells

open
nobody
None
3
2010-10-01
2010-09-26
Chris Marshall
No

By default, the pager used by perldoc is the one in $Config{'pager'}
which works ok but does not work well for platforms (such as win32)
with weak implementation of more/less. This is particularly annoying
when trying to search docs for a word since the win32 more command
does not support searches in the usual fashion.

A CPAN search shows that there is a Term::Pager module which
claims to address this problem. It's only dependency is on the
Term::Cap module which is part of the perl core module set.
If it checks out, that would greatly improve the usability of the
perl online documentation for MSWin32 systems.

We could also consider making it the default pager for all
platforms.

Discussion

  • Chris Marshall
    Chris Marshall
    2010-09-26

    Arrgh...

    I tried out Term::Pager but it doesn't work well with TERM=dumb
    and with an unset term type it works even worse. Apparently, the
    windows CMD does not support any terminal control sequences
    so it looks like something like Win32::Console::ANSI will be needed
    to get things working. As usual (for windows) it is more involved than
    I had hoped to get something working....

     
  • Chris Marshall
    Chris Marshall
    2010-10-01

    NOTE: at the cost of using an external program, one can download and install
    the less program on a win32 system, see:

    http://www.greenwoodsoftware.com/less/download.html

    Place the less.exe and lesskey.exe programs in a
    directory in your PATH (for example c:\strawberry\c\bin if
    you are using strawberry perl).

    Then you need to set the PAGER environment variable
    to less (for PDL versions 2.4.7 and below). Newer versions
    of PDL will use the value of PERLDOC_PAGER if it is set.

     
  • Chris Marshall
    Chris Marshall
    2010-10-01

    Lowering priority since there is a work around to the problem.

     
  • Chris Marshall
    Chris Marshall
    2010-10-01

    • priority: 5 --> 3
     
  • Chris Marshall
    Chris Marshall
    2010-11-03

    An additional note on using the less pager:
    I recommend setting the LESS environment
    variable to enable the -X (no init) and
    -F (quit if one screen) options for the less
    command. The following in a .bat file will
    do it:

    set LESS=-X -F

    Enjoy and happy paging...