lost esc keys - ancient history

Thomas Mitchell mitch at sgi.com
Wed Nov 21 14:18:02 AEST 1990


In article <9011041640.AA25355 at snow-white.merit-tech.com> goss at SNOW-WHITE.MERIT-TECH.COM (Mike Goss) writes:
>mike at snowhite.cis.uoguelph.ca (no relation) :-) writes:
>> rbriber at poly1.nist.gov writes:
>> 
>> >Tim Buxton writes about problems with losing the ESC character
>> >from the arrow key codes

>You have stumbled across one of the most ancient and mysterious Unix problems
>ever to vex the minds of historians!  I don't think I've ever worked on
>a Unix system that did NOT have this problem, going back to a Perkin-Elmer
>3220 running Unix Version 7 (not a misprint; Version 7 came before System V,
>for reasons known only to AT&T).
>
>Anyone who can solve this problem once and for all will certainly earn
>the thanks of Unix users everywhere, and perhaps a shot at a Nobel prize
>or Turing award, or at least an Edgar.


These can be nasty to nail down.  Try nailing down jello.

If we look at the key map for a bunch of terminals (ANSII
are worst (and best)) you will see that hand typed sequences
can mimic machine generated sequences.

To exit vi's insert mode one needs to type "ESC:wq"
or some such.  At the same time the arrow/function keys
are sending ESCsomething-clever.  

It turns out that the editor must pay attention to
the timing of the keys.  If it sees an 
	"ESC...pause....something"
the curses/editor/application might correctly
deduce that the characters are human typed.

On a network link, key strokes can be 'assembled' or not into
a packet and the timing IS NOT PRESERVED.  This makes it
impossible to know the merrit of a given ESC char.

Other strange things can happen with a terminal.  On my
Wyse-50 the down arrow emits a 'new-line(^J)' and the enter
key a CR(^M) (or was it ^M/^J).  Anyhow it took me days to
understand why I could go up, not down, left and right with
my arrow keys.  Now that I understand and I feel silly for
then using the up-arrow then Ctl-V in emacs to wander about a
file.  Emacs must do the same timing trick.  Emacs must
decide if the ESC is a special key or a pseudo Meta key.

Someday - I will dig into AT&T's streams stuff and 
see how that can interact with this whole thing. Who
knows might fix it (bridge for sale too).  

--
--
  Thomas P. Mitchell   --  mitch at sgi.com  or mitch%relay.csd at sgi.com
	"All things in moderation; including moderation."



More information about the Comp.sys.sgi mailing list