Subject: Re: zsh - vt emulation
To: Bill Studenmund <wrstuden@loki.stanford.edu>
From: Julian Bean <jules@mailbox.co.uk>
List: port-mac68k
Date: 03/06/1996 09:14:21
At 8:57 pm 5/3/96, Bill Studenmund wrote:
>> OK.  It's quite simple, really.
>>
>> zsh is expecting (it's hard-coded into zle_main.c, for those with a copy of
>> the source handy) "^[[" to introduce an arrow key, followed by {A,B,C,D},
>> whilst apparently both the console and dt send "^[O"{A,B,C,D}.
>>
>> Does anyone understand this discrepance.  Valtteri Vuorikoski says that dt
>> can be re-configured by #defining PRESENTATION in config.h, but I am
>> intrigued as to what the 'standard' is here, and who is 'wrong'.
>
>I think the difference is that in one case you get a ^[O and in
>the other, you get a ^[[. :-) The vt100 had two different modes it
>could work in. All the ULTRIX boxes at my lab expect presentation
>mode, whereas NetBSD, AIX, and the mac vt100 emulators all default to
>non-presentation. Thus on the ULTRIX boxes, I can't use the arrow
>keys while inserting in vi (though I can when not inserting).
>
>I don't know more than that. Sounds like zsh is being naughty;
>the termlib/termcap stuff should be taking care of this,
>not its hard-coding. :-)
>
>Take care,
>
>Bill

Interesting.  I was curious as to how tcsh does it (tcsh gets it right),
only to discover (ed.screen.c, I think) that tcsh simply hard-codes it to
both ^[[ and ^[O !!!.

It did also double-check the term-cap entries, and vt100 (and xterm, as it
happens) has entries for ku,kd,kr,kl and they are the ^[O{A,B,C,D} family.

I will mail the zsh-list suggesting that they use termcap.

Jules


/----------------+-------------------------------+---------------------\
|  Jelibean aka  | jules@mailbox.co.uk           |  6 Evelyn Road      |
|  Jules aka     |                               |  Richmond, Surrey   |
|  Julian Bean   |(jelibean@jmlbhome.demon.co.uk)|  TW9 2TF    *UK*    |
+----------------+-------------------------------+---------------------+
|  The Other Place - n. (pop.) Depending on the affiliation of the     |
|  speaker, one of Oxford, Cambridge, The House of Lords, The House of |
|  Commons, Hell.  Draw your own conclusions.                          |
\----------------------------------------------------------------------/