[net.graphics] TERMCAPS for v100 and long lines in vi

joe (05/01/83)

We are having trouble with vi when a line is longer  than 80
characters.  On the lines after the long line the displayed position
of the cursor and vi's idea of the cursor position differ such that
editing operations are performed on the wrong piece of text.  We have
vt100, vt101, and vt102 terminals. The symptoms are the same on all
these terminals. The display is different, but incorrect, depending 
on where or not auto margin is set during terminal set up.  Has anyone
seen this before? Or better yet does anyone have vi working with long
lines?  I have included a copy of our termcaps entry for vt100.  If
yours works better and is different please send me a copy.  Thanks.

			Joe Brady
			(...decvax!microsoft!teltone!joe or
			...uw-beaver!teltone!joe)

d0|vt100n|vt100 w/no init:is@:if@:tc=vt100:
db|vt100|vt100 w/blinking bell:\
	:vb=\E[?5h\200\200\200\200\200\E[?5l:tc=vt100b:
d1|vt100b|vt-100|pt100|pt-100|dec vt100:\
	:co#80:li#24:am:cl=50\E[;H\E[2J:bs:cm=5\E[%i%2;%2H:nd=2\E[C:up=2\E[A:\
	:ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
	:is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\
	:if=/usr/lib/tabset/vt100:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:\
	:kh=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:xn:

aam (05/02/83)

We also ran into this problem with our VT-100.  The %2 in the X co-ordinate of
the cursor motion string causes mangling of addresses past column 99.
The simplest fix is to change both %2's to %d's.  This makes the problem
go away, and also chops an extra character or two from the cursor motion
sequences used to address the first few rows and columns of the screen.
					Allen McIntosh
					...!utzoo!hcr!aam
					...!decvax!hcr!aam

kar (05/05/83)

Re: need to change the source of vi to make it work with a VT100

No, no, NO!  Don't change your source to vi to make it work on your VT100's!
Our unmodified 4.1bsd vi works fine with our VT100's.  After messing around
with it for a while, the combination I found that seems to work is as follows:

1)	Remove "pt" and "xn" from the termcap entry.
2)	SETUP the terminal so that WRAPAROUND is ON.

	This is what works for us for short and long (>80) lines.  I did this
a long time ago, and in looking at it now do not remember whether omitting "pt"
(physical tabs) is really a necessary part of the solution, but I don't have a
VT100 in my office so I don't care to find out.

	Ken Reek, Rochester Institute of Technology
	seismo!rochester!ritcv!kar

PS:	Just for the record, here is our termcap entry for the VT100:

d1|vt100|vt-100|pt100|pt-100|dec vt100:\
	:if=/usr/lib/tabset/vt100:\
	:is=\E>\E[?3l\E[?4l\E[?7h\E[?8h:\
	:am:bs:cd=50\E[J:ce=3\E[K:cl=50\E[;H\E[2J:cm=5\E[%i%2;%2H:co#80:\
	:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:kd=\EOB:ke=\E[?1l\E>:kh=\E[H:kl=\EOD:\
	:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:li#24:nd=2\E[C:se=2\E[m:so=2\E[7m:\
	:sr=5\EM:ue=2\E[m:up=2\E[A:us=2\E[4m:

PPS:	By the way, I have a script that reads termcap and sorts the capa-
bilities in each entry, which makes termcap much easier to work with.  If any-
one is interested, send me mail: if there is sufficient interest I'll post it.

wartik (05/06/83)

We had the same problem here, and corrected it by removing the "xn"
and "am" capabilities from the vt100's termcap entry.  VI has to work
a bit harder, but you don't have to change any source code.

P.S. For a good laugh, sign on to VMS, type a line as long as the
width of the screen, and see how they hack around the way their
own terminal does "brain-damaged" handling of wraparound.

guy (05/09/83)

The VT100 can run in two modes; autowrap and non-autowrap.  In non-autowrap
mode, it works like every other terminal does in non-autowrap mode (i.e.,
if a character is put in column 80, the cursor stays in column 80 and any
subsequent characters put without moving the cursor will overwrite it).  In
autowrap mode, if a character is put in column 80 the cursor moves to
some sort of "column 81", although it still displays as in column 80.
Any subsequent characters will cause the cursor to move to column 1 of the
next line (scrolling if necessary) BEFORE the character is displayed.  This
is probably so that auto-wrapping doesn't make line 24 column 80 useless
for full-screen programs, as it does on terminals which work "normally"
AND can't shut off auto-wrap.  A better solution might have been to leave
autowrap the way everyone else does it and simply have programs which
want to use line 24 column 80 (and why shouldn't they want to?) just
turn autowrap off.

What this does to "vi", I don't know, since I don't use "vi" except if
I need to look at a big file, but it might give you pointers where to look
at.

BTW, our "pathaliases" file indicates you can go directly from "seismo"
to "cbosgd".

					Guy Harris
					RLG Corporation
					{seismo,mcnc,we13,brl-bmd}!rlgvax!guy