| Summary: | Don't produce terminal control sequences in perldoc | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Pavel Raiskup <praiskup> |
| Component: | perl-Pod-Perldoc | Assignee: | Petr Pisar <ppisar> |
| Status: | CLOSED WORKSFORME | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | extras-qa, hhorak, jmlich83, mmaslano, perl-devel, ppisar, ToddAndMargo |
| Target Milestone: | --- | Keywords: | FutureFeature, Reopened |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Enhancement | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1258741 | Environment: | |
| Last Closed: | 2016-04-21 06:28:49 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | 1258741 | ||
| Bug Blocks: | |||
|
Description
Pavel Raiskup
2016-04-21 04:51:15 UTC
I cannot reproduce it on Fedora 23:
TERM=xterm
LESSOPEN=|/usr/bin/lesspipe.sh %s
ncurses-5.9-21.20150214.fc23.x86_64
ncurses-libs-5.9-21.20150214.fc23.x86_64
xterm-318-2.fc23.x86_64
less-481-1.fc23.x86_64
perl-Pod-Perldoc-3.25-347.fc23.noarch
Though I admit some people sometimes complained about the same issue. I would welcome reliable reproducer.
To the question: Yes, perldoc has "-t" argument that disables ANSI sequences on the output. I think "perldoc --help" is not so hard way to discover it.
I can fairly reproduce it with "perldoc -T perlreref | less". The capital -T prints the output to stdout instead of sending it to a pager. But the perldoc (that I have, the behavior changes with various perldoc versions) feeds the pager from a temporary file. strace shows:
[pid 3367] execve("/usr/bin/less", ["less"], ["XDG_VTNR=1", "XDG_SESSION_ID=1", "SSH_AGENT_PID=2103", "HOSTNAME=dhcp-0-146.brq.redhat.c"..., "SHELL=/bin/bash", "TERM=xterm", "HISTSIZE=1000", "TERMPATH=/home/petr/.termcap:/et"..., "WINDOWID=65011747", "QTDIR=/usr/lib64/qt-3.3", "QTINC=/usr/lib64/qt-3.3/include", "XORG_RUN_AS_USER_OK=1", "USER=petr", "XTERM_SHELL=/bin/bash", "LS_COLORS=rs=0:di=01;34:ln=01;36"..., "SSH_AUTH_SOCK=/tmp/ssh-QUjk3MkTh"..., "PAGER=less", "PATH=/home/petr/bin:/usr/lib64/q"..., "MAIL=/var/spool/mail/petr", "_=/usr/bin/less", "QT_IM_MODULE=xim", "PWD=/home/petr", "XMODIFIERS=@im=SCIM", "EDITOR=/usr/bin/vim", "LANG=cs_CZ.UTF-8", "MODULEPATH=/etc/scl/modulefiles:"..., "LOADEDMODULES=", "HISTCONTROL=ignoredups", "XTERM_VERSION=XTerm(318)", "XTERM_LOCALE=cs_CZ.UTF-8", "HOME=/home/petr", "XDG_SEAT=seat0", "SHLVL=5", "LESS=-R", "LOGNAME=petr", "CVS_RSH=ssh", "QTLIB=/usr/lib64/qt-3.3/lib", "MODULESHOME=/usr/share/Modules", "LESSOPEN=|/usr/bin/lesspipe.sh %"..., "WINDOWPATH=1", "XDG_RUNTIME_DIR=/run/user/500", "DISPLAY=:0.0", "GTK_IM_MODULE=scim", "XAUTHORITY=/home/petr/.Xauthorit"..., "CCACHE_HASHDIR=", "BASH_FUNC_module()=() { eval `/"..., "BASH_FUNC_scl()=() { local CMD="...]) = 0
I suspect perldoc sets LESS=-R. I dont' have the variable in my environment:
$ set |grep LESS
LESSOPEN='|/usr/bin/lesspipe.sh %s'
"perldoc -T perlreref | LESS=-R less" works for me.
From my point of view, perldoc is fine in Fedora. This is issue in RHEL-7's perldoc.
Actually I cannot reproduce it in RHEL-7 either. Thought it works there probably for some other reason. If you want to open a bug for RHEL-7, I need the reproducer. (In reply to Petr Pisar from comment #1) > I cannot reproduce it on Fedora 23: I feel I'm facing some magic, because I'm not able to reproduce this on F23 neither, *now*. > To the question: Yes, perldoc has "-t" argument that disables ANSI sequences > on the output. I think "perldoc --help" is not so hard way to discover it. The question is whether it would be possible to not print terminal sequences *by default*; not how it can be done. But yes -- as it obviously works on F23, there is no need to change anything. > I suspect perldoc sets LESS=-R. I dont' have the variable in my environment: That's right. > From my point of view, perldoc is fine in Fedora. This is issue in RHEL-7's > perldoc. Correct. (In reply to Petr Pisar from comment #2) > Actually I cannot reproduce it in RHEL-7 either. Thought it works there > probably for some other reason. If you want to open a bug for RHEL-7, I need > the reproducer. In RHEL7, I'm able to reproduce it. Perldoc does not set the LESS variable, can be debugged by: $ cat lesswrap #! /bin/sh env | grep -i less less "$@" $ PAGER=./lesswrap perldoc perlreref Petr, can you confirm? (In reply to Pavel Raiskup from comment #3) > In RHEL7, I'm able to reproduce it. Perldoc does not set the LESS variable, > can be debugged by: > > $ cat lesswrap > #! /bin/sh > env | grep -i less > less "$@" > > $ PAGER=./lesswrap perldoc perlreref > > Petr, can you confirm? While, of course, you can use: $ PERLDOCDEBUG=1 PAGER=./lesswrap perldoc perlreref $ # hit the CTRL^Z $ # open the temp file generated by perldoc to see that the color sequences # are there. Yes, in RHEL-7 if the PAGER is defined, then the ANSI sequences are not interpreted. |