in reply to strange output characters from perldoc

dbae:

The previous posters are correct. Having said that, you might look at your shell initialization script: I'm guessing that it's setting your TERM variable to something incompatible with your command console. Many *nix programs will read the TERM variable to determine what features it can use to format your output better. However, if it's set to something incompatible with your terminal program, you'll get exactly the situation you describe. Be sure to check that your terminal software has enough features, too. If you want color, boldface, underlines, etc., be sure you use a program that handles it.

The documentation for your terminal software should tell you enough information to figure out what the correct TERM value should be. (Though it may be overly cryptic, or not stated directly enough.) For example, the terminal I'm using here at work is mintty, and in the documentation it mentions:

Terminal emulation settings.

Type (Term=xterm)

The terminal type. This determines the setting of the TERM environment variable at mintty startup. Choices available from the dropdown list are xterm, xterm-256color, xterm-vt220, vt220, and vt100.

If the setting contains "vt220", xterm VT220-style function key mode is enabled instead of the default PC-style function key mode. (This can otherwise be set with the DECSET 1061 control sequence.)

Apart from that, this setting has no effect on mintty's terminal emulation, i.e. all the features are always available. However, the TERM setting does tell applications what features they can use.

The xterm-256color setting enables 256-color mode in some applications, but may not be recognised at all by others, which is why plain xterm is the default.

So on my setup, I'm using TERM=xterm (I would have added it to my .bashrc script, except that mintty defaults to setting the value for me.)

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: strange output characters from perldoc
by dbae (Beadle) on May 02, 2012 at 17:13 UTC

    echo $TERM gave me xterm-color, so I set it to xterm, but no change to output from perldoc perldoc resulted. I'm stuck between not knowing enough *n*x and not knowing enough MacOsX. MacOsX has an entirely non-*n*x way of setting properties of the terminal emulator given by the MacOsX program Terminal, but one can also affect things in the usual *n*x way. I haven't been able to find anything in MacOsX saying "set the properties of the terminal emulator to vt220", or anything similar. However, I don't have the time to go into it all, so I'm just going to leave matters in their current unsatisfactory state. At least, using the advice given here, I now have several ways of reading the output from perldoc, and also perdoc.org, and this has improved my relationship with perl. Thanks to everyone for this.

      Perhaps OS X Terminal Emulation Woes might be handy? If not, you might look to see if you can download a copy of RXVT or similar.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.

Re^2: strange output characters from perldoc
by Anonymous Monk on Apr 30, 2012 at 13:38 UTC

    Hi :) this means text

    $ echo %os% Windows_NT $ echo %term% dumb