[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

On Sun, 05 Apr 2015 04:01:10 -0400 (EDT), 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.
> How does the terminal handle control-m carriage returns?  Normally at
> the terminal will receive a CR-NL pair and will move the cursor left
> and then down.  It seems likely those 'm's are CR characters.  It
> would be good to verify that.
>   $ printf "This is a CR char: ==\r==\n"
> If it is a normal terminal we would see this.  Because the CR moves
> the cursor to the left and the next two "==" chars overwrite the "Th"
> of "This".  Then the newline is translated to a CR-NL pair and moves
> the cursor left and down.
>   ==is is a CR char: ==
> But if it is the CR chars producing the 'm' for you then it would
> print this:
>   This is a CR char: ==m==
> Then at least you would know it is the CR that isn't handled like in a
> standard terminal.

When I run the above test, I see

==is is a CR char: ==

as expected.

That was my first thought too.  But I only see these "m"s when viewing
man pages.  Standard Linux text files look fine when viewed natively
in less.  Something in man, or in something invoked under the covers
by man, is responsible for these "m"s.

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.
But man still shows those "m"s at the end of every line.

  .''`.     Stephen Powell    <zlinuxman@wowway.com>
 : :'  :
 `. `'`

Reply to: