0

I'm using a Wyse50 Terminal emulation on Rocky Linux 9. Man pages, help screens, etc., are unusable because the system outputs attribute and color codes that the terminal emulator doesn't understand; so, for example, man cp reads like this:

1mSYNOPSIS0mm
       1mcp 22m[4mOPTION24m]... [4m-T24m] 4mSOURCE24m 4mDEST0mm
       1mcp 22m[4mOPTION24m]... 4mSOURCE24m... 4mDIRECTORY0mm
       1mcp 22m[4mOPTION24m]... 4m-t24m 4mDIRECTORY24m 4mSOURCE24m...m  m

1mDESCRIPTION0mm

I've updated the latest terminfo packages and did an infocmp between the latest wy50 and the wy50 from a Linux 4 where everything worked fine.

I see nothing in profile, bash_profile, bashrc or .bashrc that would set any color parameters.

What am I missing? (other than a legacy application that belongs in the prior century)

4
  • 2
    What is $TERM set to? Commented Dec 20, 2022 at 18:34
  • wy50;wyse50;wy50-25;wy60;wy60-25 -- tried them all Commented Dec 20, 2022 at 21:37
  • I suggest editing the summary text of your question. Please prefix the word "Rocky" to "Linux 9" since "Linux 9" will have either no or a confusing meaning to many SE contributors. Next, none of the escape sequences are "color"; the ones you quoted, in technical terms, selected graphic renditions involving boldface or underline attributes. These sequences are standardized in ISO 6429 (a gratis version is available in ECMA-48). Nevertheless many people call these ANSI escape sequences in vague reference to ANSI X3.64, which (I think) was withdrawn in favor of the international standards. Commented Dec 22, 2022 at 1:16
  • What are you using as a Wyse 50 terminal emulator? Is it Free Software? I'm tempted to try this myself. Commented Dec 22, 2022 at 23:45

3 Answers 3

1

I object to Thomas Dickey's characterization of this behavior as a misfeature.

I have laid out my reasons thoroughly elsewhere.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=312935

The short version is that neither the Wyse 50 nor modern terminal emulators nor *ix kernel console devices are emulators of Teletype machines.

For groff 1.24, I would like to make grotty a terminfo application so that it can more intelligently adapt to terminal capabilities.

Even once it does that, however, it will not reliably mimic a Teletype Corporation Model 37, because most terminal emulators in use today cannot do so.

In the meantime you can set the GROFF_NO_SGR environment variable.

4
  • That export still leaves a lowercase "m" at the end of every line and at the beginning of every blank line. Commented Dec 21, 2022 at 21:36
  • That sounds like an error in your terminal description. While "m" is used to end SGR escape sequences--see ECMA-48 or the xterm ctlseqs.ms document that Thomas Dickey maintains. Now that you mention it, I see an extra m at the end of every line. Try the command tput cr | od -c. Commented Dec 22, 2022 at 0:52
  • ?2004h[root@serv w]# tput cr | od -c 0000000 \r 0000001 ?2004h[root@serv w]# Commented Dec 22, 2022 at 16:51
  • Darrel, thanks. I don't see anything wrong with that value for the cr capability. Please try echo | nroff | od -c. Commented Dec 22, 2022 at 22:02
1

That's groff's hard-coded default behavior (ncurses and terminfo are not involved). It's a misfeature introduced in February 2002 (see Debian #257413). As a workaround, you can set the environment variable GROFF_NO_SGR to some non-empty value.

Almost all (none that you're likely to encounter) video terminals do what is expected with a sequence of character, backspace, overstrike (over underscore or the same character). This is sometimes mis-characterized as ASR 33, though that is not a video terminal, but a printer (I've used both, of course).

Further reading:

1
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – terdon
    Commented Jan 14, 2023 at 15:17
0

In general in a Linux distro or other Unix system, when using a serial port or equivalent pseudo-terminal (such as in an ssh or telnet session), individual programs' output goes directly to the terminal as-is -- there isn't any kind of translation layer for terminal formatting escape sequences in the Linux kernel or anywhere else.

Many programs will try to produce appropriate output for the terminal you're using, as determined from the TERM environment variable setting, themselves, often with the help of libraries such as terminfo and termcap and the like, but those that don't don't -- if you run something that doesn't, and it expects a terminal type you don't have and outputs inappropriate escape sequences, your terminal will receive inappropriate escape sequences.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .