Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!decvax!decwrl!ucbvax!ttrdc.UUCP!levy From: levy@TTRDC.UUCP Newsgroups: mod.computers.vax Subject: (none) Message-ID: <8603092107.AA10233@ucbvax.berkeley.edu> Date: Sun, 9-Mar-86 16:07:48 EST Article-I.D.: ucbvax.8603092107.AA10233 Posted: Sun Mar 9 16:07:48 1986 Date-Received: Tue, 11-Mar-86 08:39:47 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 30 Approved: info-vax@sri-kl.arpa Subject: Re: Keyboards, ^S, ^Q, and ESC In-reply-to: article <12187370727.27.JBS@DEEP-THOUGHT.MIT.EDU> Lemme put in my two cents worth on ESC. ESC is used in the Unix [whazzat you say? Ever hear of that user friendly interactive OS developed by AT&T?] screen editor 'vi' as a means of leaving insert-text mode and re-entering command mode. Yet, vi is quite capable of understanding special-key sequences beginning with ESC, even though hitting ESC in command mode by itself just sounds the bell (or flashes the screen if the terminal is thus capable). I bet you all wonder how vi can make this distinction. Well, it's simple. vi waits for a short period after getting an ESC to see what else it gets right afterward. If the ESC was immed- iately followed by the rest of a special-key sequence, vi obeys it. If the ESC is NOT followed by the remainder of a special-key sequence, or something else which should be valid in command mode, during that wait, vi beeps or flashes to indicate an error. By this means, vi can not only distinguish a bare ESC, it can distinguish a bare character of ANY kind that happens to start off some weird terminal's idea of a special-key sequence. (vi uses termcap, or more recently, terminfo, terminal descriptions which I believe are the most flexible in the world in terms of the terminals which can be accommodated. Try THAT with EDT or most other VMS-bound screen editors :-). -- ------------------------------- Disclaimer: The views contained herein are | dan levy | yvel nad | my own and are not at all those of my em- | an engihacker @ | ployer or the administrator of any computer | at&t computer systems division | upon which I may hack. | skokie, illinois | -------------------------------- Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa, vax135}!ttrdc!levy