You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bold and underlined formatting you see in man pages is produced using backspace (BS) control characters. This harks back to the days of the typewriter, where to make text bold you would print a character, backspace, and then print it again. For underlined text you would print an underscore, backspace, and then print the character.
It looks like this backspace is not being interpreted in the print output, so the bold text has these duplicated characters and underlined text includes the underscores. I'm not familiar enough yet with Rich to explain why you're seeing this only on macOS but not Linux though...
You probably want to strip these BS control characters from your document:
On MacOS 14.0 copying and pasting the text to a document named man.1 did not reproduced the error but creating the document using man man > man.1 did.
Using vim, we can see that the document created by man man > man.1 has some unique characters added (not sure what it means but seems to be related to what @TomJGooding mentioned)
Describe the bug
python3 -c 'import rich; rich.get_console().print(open("man.1", "rt").read())'
And this is what I get:Specifying
markup=False
toconsole.print
does not make any difference.The original document content looks like this:
I got this original text by
man man > man.1
.Mac OS 14.0. Found this issue in Terminal.
If you're using Rich in a terminal:
The text was updated successfully, but these errors were encountered: