why are there backspace characters in the output of man(1) ?

<-- back to elb's homepage

I recently added the ability to insert the output of a command into a buffer to my text editor, fkv. However, when inserting the output of man(1), I saw weird chars after each letter of headings. My first guess was that those where formatting escape sequences, but then, why isn't man smart enough to not print them when outputting to a pipe ? Turns out, the way man makes text bold isn't by printing escape sequences, but by printing the letter, the backspace, then the same letter again. Wich makes perfect sense... On a paper terminal from the seventies. To remove those backspaces, one can pipe man into col -b.

This discovery made me fall into the rabbit hole of teletypewritters and I wanted to experiment with them. However, they are very hard to find and very expensive. However, old IBM selectric typewritters are much easier to find and a lot cheaper, so I bought one with the project of turning it into a teletypewritter, wich has already been done. IBM would even sell conversion kits at some point. Right now, it is a bit broken and can't even function as a normal typewritter, but it should be relatively easy to fix. Expect updates about this soon(ish).