Re: ESCAPE key (was Re: How can I assign the interrupt action...)
Posted in 1992
}From: uunet!uceng.uc.edu!carsinfo!carsmax!bryan (Bryan Klopfenstein) }Message-Id: <9207071316.AA06173@carsmax.COM> }Subject: ESCAPE key (was Re: How can I assign the interrupt action...) }Date: Tue, 7 Jul 92 9:16:12 EDT }X-Informix-List-Id: <list.1301> } }Jonathan Leffler says: }> I had to deal with a variant of this only last week -- the customer wanted }> the ESCAPE key to be the interrupt character. Uggghhhhh! Well, it can be }> done: stty intr '^[' sets the interrupt character to ESCAPE. But it breaks }> all your 7-bit terminals which send things like ^[[ as a control sequence }> introducer (CSI) before the function key codes. 8-bit terminals might send }> 0x91 instead (if my memory serves me right), and you might then be OK, but }> I wouldn't want to bet on it. The customer was eventually persuaded that }> their request was not sensible! } }Thanks for the explanation! I have always wondered why there are so many }problems trying to use the ESCAPE key for "function key-like" operations. } }However, I'm also confused. Isql uses the ESCAPE key to start a query, }the ubiquitous vi uses the ESCAPE key and escape sequences (such as }arrow keys) quite well. Many programs use the ESCAPE key to interrupt }or cancel the current operation -- unlike isql which uses it to start }EXECUTING, probably the reason for your customer's request. } }How can all these other programs work so well under what appear to be }the same constraints you explain above? There is no problem unless you wish ESCAPE to be your INTERRUPT key. If you set your interrupt key to be ESC, then whenever the kernel sees the ESC character, it treats it as an interrupt. ISQL works fine using ESC for ACCEPT, provided you haven't set interrupt to ESC using stty. Ditto for all your function keys. And ESC on its own is no problem, even if your function key sequences also start with ESC, provided ESC isn't your interrupt character. Incidentally, Informix products will wait for 1 second (or whatever DBESCWT is set to) to acknowledge that an ESC on its own is indeed just ESC, not the start of a function key, which is why you sometimes get a noticeable pause after hitting the ESC key. Yours verbosely, Jonathan Leffler (johnl@obelix.informix.com) #include <disclaimer.h>