Sometimes running man outputs badly line-wrapped text. If I run man, quit, then resize the terminal window and run man again, it formats it according to the new window width. But if I run man, resize the window (the text gets messy), quit, and then run man again, it still formats it badly like before.

But sometimes it doesn't happen even if I resize the window while man is running, and sometimes it happens even after I make a new, resized terminal before running man for the first time in that window.

How can this be fixed? I have tried the man -c option and R, r, ⌃R and ⌃L to “repaint” the screen while viewing the manpage (my man uses less).

I don't have MANWIDTH set. I'm using iTerm2.

migrated from stackoverflow.com Mar 16 '12 at 20:27

This question came from our site for professional and enthusiast programmers.


Sounds like a bad interaction between cat pages (the cache of already-formatted man pages) and the fact that man uses the current width of the terminal at time-of-formatting. In the output of man man (the man page for the man command), I see:

No cat pages are saved when the required cat directory does not exist.
No cat pages are saved when they are formatted for a line length different
from 80.  No cat pages are saved when man.conf contains the line NOCACHE.

That may help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.