Bug 1244190

Summary: less displays man pages incorrectly on vt100-nav
Product: Red Hat Enterprise Linux 8 Reporter: Ondřej Lysoněk <olysonek>
Component: man-dbAssignee: Nikola Forró <nforro>
Status: CLOSED WONTFIX QA Contact: RHEL CS Apps Subsystem QE <rhel-cs-apps-subsystem-qe>
Severity: medium Docs Contact:
Priority: low    
Version: 8.2CC: hhorak, isenfeld, nforro, olysonek
Target Milestone: rc   
Target Release: 8.2   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-01 03:02:44 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:
Embargoed:
Attachments:
Description Flags
screenshot
none
man 2.6.3 screenshot
none
man 2.7.1 screenshot
none
man 2.7.1 screenshot, xterm emulator none

Description Ondřej Lysoněk 2015-07-17 12:38:10 UTC
Created attachment 1053062 [details]
screenshot

Description of problem:
less displays man pages incorrectly on the vt100-nav terminal. The words at the ends of lines are duplicated and new lines are inserted where they shouldn't be.

Version-Release number of selected component (if applicable):
less-458-8.el7

How reproducible:
always

Steps to Reproduce:
1. Open a terminal with width small enough to force 'man' break lines (e.g. 80 characters will do)
2. Set terminal type to vt100-nav
TERM='vt100-nav'
3. view some man page using 'less' as the pager
man -P less man

Actual results:
Words at the ends of lines are strangely duplicated, lines are broken where they shouldn't be, etc. The attachment contains an example screenshot.

Expected results:
The man page is correctly displayed.

Additional info:
This should not be a bug in 'man' because when using 'more' as the pager, the described problem does not occur.

Comment 2 Viktor Jancik 2015-07-22 10:00:25 UTC
Created attachment 1054770 [details]
man 2.6.3 screenshot

Comment 3 Viktor Jancik 2015-07-22 10:00:57 UTC
Created attachment 1054771 [details]
man 2.7.1 screenshot

Comment 4 Viktor Jancik 2015-07-22 10:04:11 UTC
Steps taken:
I successfully reproduced the error on RHEL7 with less 458 and man 2.6.3.
I was unable to reproduce the error on F22 with less 471 and man 2.7.1.
I ruled out less by reproducing the error on RHEL7 with less 471 (built on RHEL7) and man 2.6.3.
I ruled out the dependencies by building man 2.6.3 on F22 (against newest versions of dependencies) and still being able to reproduce the error.

I conclude the bug is in the package man-db 2.6.3 and appears to be fixed in the version 2.7.1.

Comment 5 Ondřej Lysoněk 2015-07-23 07:35:29 UTC
(In reply to Viktor Jancik from comment #4)

Please note that in the screenshot from man-db 2.7.1 you provided, the problem is not fully fixed. The lines are still broken where it's not necessary and the text is not aligned.

Also, my guess is that the terminal setting is somehow ignored in 2.7.1 because the highlighted words are not highlighted the way they should be. I believe the vt100-nav does not support displaying text in boldface, which is why the colors are inverted on this terminal instead. However, this does not happen in your 2.7.1 screenshot.

Comment 6 Viktor Jancik 2015-07-24 12:27:58 UTC
Created attachment 1055720 [details]
man 2.7.1 screenshot, xterm emulator

Comment 7 Viktor Jancik 2015-07-24 12:39:51 UTC
(In reply to Ondřej Lysoněk from comment #5)

The screenshot I added is made on F22 with the command "man man" under normal circumstances.

Man takes the number of characters per line when it is executed and fits the text to that. The screenshot I took is after shrinking the terminal screen after initial execution. Lines that are too long get rewritten to the next line, however the original line widths are kept.
You can see this behavior when you extend the terminal screen.
The text doesn't extend to fit to the new width.

Therefore I would say this is normal man behavior and is indeed fixed in my previous man 2.7.1 screenshot.

Note: Some characters are on the next line. This is because I changed the look of my terminal (colorscheme, fonts) since the original screenshot.

Comment 8 Ondřej Lysoněk 2015-07-24 14:07:29 UTC
(In reply to Viktor Jancik from comment #7)

> Man takes the number of characters per line when it is executed and fits the
> text to that. The screenshot I took is after shrinking the terminal screen
> after initial execution. Lines that are too long get rewritten to the next
> line, however the original line widths are kept.

Oh, I didn't know you resized the window.

However, the behaviour where the highlighted text (boldface, underlined) is displayed with colors inverted on the vt100-nav terminal, is (I think) desirable. This behaviour however seems to have been dropped in man 2.7.1. Just saying.

Comment 10 Nikola Forró 2016-03-01 17:22:59 UTC
The issue is reproducible even with man-db 2.7.1 by setting GROFF_NO_SGR environment variable:

TERM='vt100-nav' GROFF_NO_SGR=1 man -P less man

This forces groff to render in "overstrike mode" (default behavior in man-db 2.6.3), and less seems to have trouble displaying that correctly on vt100-nav.
It works fine however when less is used with -r option:

TERM='vt100-nav' GROFF_NO_SGR=1 man -P 'less -r' man

So I think this may be less issue after all.

Comment 12 Nikola Forró 2019-12-20 11:15:48 UTC
Yes, this is an issue even on RHEL 8. I'm still not certain it is a man-db issue though.

Comment 15 RHEL Program Management 2020-11-01 03:02:44 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.