[comp.unix.questions] Terminfo problem/question

lcz@dptudg.sat.datapoint.com (Lee Ziegenhals) (04/22/89)

I would like to understand the behaviour of my vt220 terminfo entry better.
I am running System V/68 R3V5, and am using a vt220 terminal.  The problem
is that the behaviour of the right margin "wraparound" is puzzling me.  The
terminfo entry has an initialization string (is2) that turns ON automatic
right margin wrap with "<esc>[?7h".  It also has an enter_ca_mode string
(smcup) that turns OFF auto margin with "<esc>[?7l".  The automatic right
margin boolean (am) is NOT defined.

Programs that do not use the terminfo database will wrap at the right margin
because the initialization string has set the terminal into auto wrap mode.
Vi works fine, too, because it appears to send the smcup string, and then
perform its own wraparound when required.

The problem is that some programs (specifically elm and rn) cause the
terminal to "double space" lines that extend past column 79.  They see that
the terminfo entry does not define the "am" boolean, so assume that they
must perform their own wraparound.  However, they do not send the smcup
string, so the terminal IS in auto wrap mode.  If I manually send the smcup
string (by typing "tput smcup") before entering elm or rn, everything works
fine.  Of course, I lose that the next time a program sends the initialization
string.  If I modify the terminfo entry to define the "am" boolean, then
elm and rn work fine, but vi quits working right.

Is this a problem in the terminfo entry, or is this a problem in the
application programs, or am I just missing something somewhere?  The "am"
boolean appears to define a single state regardless if one is in "ca_mode"
or not.  Given that, should the terminal wrap differently depending on
whether one is in the "ca_mode" or not?

Thanks in advance for the help!

gwyn@smoke.BRL.MIL (Doug Gwyn) (04/23/89)

In article <136@dptudg.sat.datapoint.com> lcz@sat.datapoint.com (Lee Ziegenhals) writes:
>Is this a problem in the terminfo entry, or is this a problem in the
>application programs, or am I just missing something somewhere?

It's a combination of the terminal design and erroneous assumptions being
made by the applications.  You may be able to work around this by changing
the number of columns in the terminal description to 79, which will avoid
ever triggering the VT220 autowrap behavior (unless the applications are
REALLY out to lunch).