When I use watch to follow a perlpod documentation i am writing, the formatting gets mangeled (see NAME and Synopsis sections):

Every 2,0s: perldoc lib/Uki/Handlers/SOS.pm                                                   Tue Apr  8 10:42:43 2014

Uki::Handlers::SOS(3) User Contributed Perl DocumentationUki::Handlers::SOS(3)

       Uki::Handlers::SOS - Studenten-Handler

S Sy yn no op ps si is s
       SOS-spezifische Spezialisierung des Uki::Handlers::Person-Handlers.

I think this is due to nroff thinking the output terminal is not a TTY, but I don't know how to tell it that, infact, it is a TTY.


You are right, your issue is the rendering of the beautification done by nroff/groff.

To avoid this beautification, bypass nroff/groff and output your pod documentation into text with pod2text (this is a part of Perl distrib, so you should have it):

watch "pod2text <your_perl_withpod_file>"
| improve this answer | |
  • Yeah, that works, but I lose the formatting information, which I'd like to preserve. – sschober Apr 8 '14 at 11:43
  • You are only losing the bold characters. The pod formatting is all there otherwise. – Ouki Apr 8 '14 at 12:13

"but I lose the formatting information, which I'd like to preserve."

It isn't that it thinks you aren't on a tty, it's that it thinks you are on a really old tty which does overstrike tricks through grotty, the back-end processor of groff. From the man page:

Use the -c switch to revert to the old behaviour, printing a bold character c with the sequence 'c BACKSPACE c' and an italic character c by the sequence '_ BACKSPACE c'. At the same time, color output is disabled. The same effect can be achieved by setting either the GROFF_NO_SGR environment variable or using the 'sgr' X command (see below).

The problem is that you don't want -c or GROFF_NO_SGR set but for some reason it thinks one or both of them is.

Check your environment for GROFF*, and the TERM variable for sane values.

| improve this answer | |
  • I'm using urxvt-unicode Verison 9.19-1 on an up-to-date archlinux. My environment has no settings concerning GROFF*. My TERM Variable is TERM=rxvt-unicode-256color, but it makes no difference when I set this to xterm (or switch to xterm completely). – sschober Apr 9 '14 at 8:39

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.