[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Trailing "m"s at the end of every line when viewing man pages

Stephen Powell wrote:
> Bob Proulx wrote:
> > Stephen Powell wrote:
> >> ...
> >> But when I issue the MAN command, I see lower-case "m"s
> >> at the end of each line.

D'oh!  I apologize for not having read this correctly.  I had
completely missed that it was only happening with 'man' and not all of
the time.  Sorry.  My question was a non-sequitur with the above.  You
stated it clearly then.  My bad.

> I did discover that the ibm3151 terminal definition in ncurses falsely
> advertises support in the terminal for scrolling backward, which the
> 3151 does not, in reality, support.  Therefore, I have switched to
> using ncurses terminal definition ibm3161 instead of ibm3151.  The
> ibm3161 terminal definition does not advertise support for scrolling
> backward.  The 3161 is the 3151's closest relative, and predecessor.
> I now get the message
> WARNING: terminal is not fully functional
> from "less" every time I invoke less, including when I invoke "man".
> But I can overcome this with
> LESS="-h 0 -d"
> export LESS
> Now I don't get the error message, and less uses screen repainting
> instead of backward scrolling when I press the "b" key in less.

Cool!  Good debugging and good workaround for the terminal insufficiency.

If the actual ibm3151 terminal definition in the terminal database
isn't correct then please consider filing a bug report so that it can
be updated so that it will just work correctly for others in the

> But man still shows those "m"s at the end of every line.

I would try dumping a man page to a file and then examining the file
to understand if the 'm's are in the man output or an artifact of
browsing on the terminal with less.  My strategy would be to divide
and conquer.  Is the problem here or there?  Try to determine which
direction to keep debugging.

  man man > man.fmt

Then examine the file.  I personally would use something like this:

  od -Ax -tx1z -v man.fmt | head -n40
  od -Ax -tx1z -v man.fmt | less +/0a

But use whatever commands you are comfortable with examining the
file.  That will say if the 'm's are in the file or not.

If not then it must be somehow still associated with less and the
terminal database.  Would probably try something like this to debug if
the terminal data still has issues:

  TERM=dumb man man
  TERM=dumb man man > man.fmt
  TERM=dumb less -h0 -d man.fmt

If the 'm's are in the file then it is something in the man page
formatting pipeline.  I would run it directly and verify its output.
Something like this:

  zcat /usr/share/man/man7/man.7.gz | nroff -man

  zcat /usr/share/man/man7/man.7.gz | nroff -man | od -Ax -tx1z -v | less +/0a

Hopefully one direction or the other will point to where those 'm's
are coming from.


Attachment: signature.asc
Description: Digital signature

Reply to: