Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/12/84; site desint.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!tektronix!hplabs!sdcrdcf!trwrb!desint!geoff
From: geoff@desint.UUCP (Geoff Kuenning)
Newsgroups: net.unix
Subject: Re: vt100 cursor keys not working in vi - fix
Message-ID: <347@desint.UUCP>
Date: Sat, 2-Mar-85 17:32:50 EST
Article-I.D.: desint.347
Posted: Sat Mar  2 17:32:50 1985
Date-Received: Thu, 7-Mar-85 05:32:32 EST
References: <8684@brl-tgr.ARPA>
Organization: his home computer, Manhattan Beach, CA
Lines: 28

>On the few occasions when I use "vi"
>(heh heh), I've seen it get confused when I use the arrow keys on my
>VT100, so I've adjusted to using h/j/k/l.  I suspect it may be related
>to the fact that "vi" does timeouts on input to distinguish escape sequences
>from normal typing (but since I rarely use "vi" I don't really care why
>it does it).

The problem frequently isn't timeouts, it's a termcap error.  I have seen
many vt100 termcap entries (including, I believe, 4.1BSD) that select "DEC
Cursor Key Mode".  In this mode, the arrow keys send OA-OD rather
than the usual [A-[D.  Unfortunately, the termcap definitions of
ku, kl, kd, and kr use the [ form rather than the O form.  The
fix is simple:  either change the :is: capability to stop selecting the
O form (probably the preferred choice) or change the k[udlr] entries to
list the O form (less desirable because some programs don't send the
"is" capability).  The string to remove from the "is" capability is
"[?1h";  this should be changed to "?1l" (note that these may be
embedded in a longer [...h strings).

Speaking of this, does anybody know of a use for this "feature" of DEC
terminals?  To my mind it is one of DEC's most useless options, right up
there with the recently-discussed PDP-11 MARK instruction.
-- 

	Geoff Kuenning
	Unix Consultant
	(213) 545-4413
	...!ihnp4!trwrb!desint!geoff