
perlbug-followup at perl
Jan 17, 2010, 6:21 PM
Post #1 of 6
(341 views)
Permalink
|
|
[perl #72156] perldoc should ask less to handle ANSI escapes
|
|
# New Ticket Created by Joshua b. Jore # Please include the string: [perl #72156] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=72156 > This is a bug report for perl from jbenjore [at] w3m211a, generated with the help of perlbug 1.39 running under perl 5.11.3. ----------------------------------------------------------------- [Please describe your issue here] It's apparently becoming common for pod2man's output to use ANSI escape codes for highlighting instead of overstrike using backspaces. Historically the section names like NAME are highlighted by outputting "N\bNA\bAM\bME\bE" so a line printer would overstrike. groff from MacPorts and mandriva Linux and I suppose more places is now printing "\e[.1mNAME\e[.0m" as ANSI escapes. Seemingly all versions of less will just display the escape codes "ESC[.1mNAMEESC[.0m" with the "ESC" part highlighted because it's a control character. less versions less than 419 checked the first 64 characters which worked out just fine: 'strict(3) User Contributed Perl Documentation ' less version version 419+ check the first 256 bytes for "binary" and thinks the escape character is binary. In general, just ask less to interpret the escape codes: -r or --raw-control-chars Causes "raw" control characters to be displayed. The default is to display control characters using the caret notation; for example, a control-A (octal 001) is displayed as "^A". Warning: when the -r option is used, less cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various display prob- lems may result, such as long lines being split in the wrong place. -R or --RAW-CONTROL-CHARS Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained correctly in most cases. ANSI "color" escape sequences are sequences of the form: ESC [. ... m where the "..." is zero or more color specification characters For the purpose of keeping track of screen appearance, ANSI color escape sequences are assumed to not move the cursor. You can make less think that characters other than "m" can end ANSI color escape sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color escape sequence. And you can make less think that characters other than the standard ones may appear between the ESC and the m by setting the environment variable LESSANSIMIDCHARS to the list of characters which can appear. Perhaps should update Configure to set $Config{pager} to '/usr/bin/less -R' instead of merely '/usr/bin/less' when we're using less. Should also update Pod::Perldoc to use `less -R' [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=library severity=low module=Pod::Perldoc --- Site configuration information for perl 5.11.3: Configured by jbenjore at Wed Dec 30 23:51:21 PST 2009. Summary of my perl5 (revision 5 version 11 subversion 3) configuration: Commit id: 9c3f2640bc47839fced0ccc78bae4b814ae82e97 Platform: osname=darwin, osvers=10.2.0, archname=darwin-thread-multi-2level uname='darwin w3m211a 10.2.0 darwin kernel version 10.2.0: tue nov 3 10:37:10 pst 2009; root:xnu-1486.2.11~1release_i386 i386 ' config_args='-des -Dcc=ccache gcc -Dprefix=/opt/perl-5.11.3-64-thr-dbg -Dusedevel -DDEBUGGING -Duse64bitint -Dusethreads' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='ccache gcc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include', optimize='-O3 -g', cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include' ccversion='', gccversion='4.2.1 (Apple Inc. build 5646) (dot 1)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib -L/opt/local/lib' libpth=/usr/local/lib /opt/local/lib /usr/lib libs=-ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector' Locally applied patches: --- @INC for perl 5.11.3: /opt/perl-5.11.3-64-thr-dbg/lib/site_perl/5.11.3/darwin-thread-multi-2level /opt/perl-5.11.3-64-thr-dbg/lib/site_perl/5.11.3 /opt/perl-5.11.3-64-thr-dbg/lib/5.11.3/darwin-thread-multi-2level /opt/perl-5.11.3-64-thr-dbg/lib/5.11.3 . --- Environment for perl 5.11.3: DYLD_LIBRARY_PATH (unset) HOME=/Users/jbenjore LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/Users/jbenjore/src/git-utils:/opt/perl-5.10.1/bin:/Users/jbenjore/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Users/jbenjore\ /src/whitepages-git-utils/ PERL_BADLANG (unset) SHELL=/bin/bash
|