Red Hat Bugzilla – Bug 658132
MANPAGER is always invoked even when output is not a tty
Last modified: 2011-04-21 07:15:26 EDT
I noticed with the change from man to man-db that I
could no longer drill down into man pages using ctrl-[ in vim
(I use vim as my man page viewer for colors and drill down).
The basic cause of this is that man is filtered through
$MANPAGER even if output not a terminal. This is demonstrated with:
MANPAGER="tr a-z ." man man | cat
Therefore if you set MANPAGER to be vim, the following gives a vim warning
man man | cat
vim also does `/usr/bin/man | col -b` internally when ctrl-[ done on a reference. That in turn will fail with the same error.
This also breaks info -> man fallback. info seems to do something like
`man word | less` and that will break if MANPAGER is being set to vim for
eg. which is confirmed with:
MANPAGER=should_not_run info selinux
I can work around this for vim at least by doing this in my .vimrc
"Ensure vim is not recursively invoked (man-db does this)
"when doing ctrl-[ on a man page reference
au FileType man let $MANPAGER=""
However, I don't think I should have to do this.
Also I'm not sure anyone would depend on $MANPAGER
always being used, given it wasn't for the previous "man" package.
Thanks for your report. I've fixed it upstream in bzr revision 1289:
Thu Dec 2 12:33:43 GMT 2010 Colin Watson <firstname.lastname@example.org>
* src/man.c (make_display_command): Don't start a pager if standard
output is not a tty (Fedora bug #658132).
* NEWS: Document this.
Thanks Colin! Good monitoring!
FYI, vim at least will work around the issue:
I presume Fedora will patch in your fix.
There'll be a few conflicts in the patch (command_* -> pipecmd_* in more recent versions of man-db) but it should be easy enough to figure out. Whoever's doing this can give me a shout if they need a hand, of course.
Oops - this caused test failures on its own. You'll need to backport revision 1291 as well. Sorry.
Thanks, now the rawhide version (man-db-18.104.22.168-1) fixes this problem.