Escape sequence |
An escape sequence is a series of character (computing)s used to trigger some sort of command state in computers and their attached peripherals.
It is commonly used when the computer and the peripheral have only a single channel in which to send information back and forth. If the device in question is dumb and can only do one thing with the information being sent to it (for instance, print it) then there is no need for an escape sequence. However most devices have more than one capability, and thus need some way to tell data from commands.
For instance, the Hayes command set defines a single escape sequence, +++ . When the modem encounters this in a stream of data, it switches from its normal mode of operation which simply sends any characters to the phone, to a command mode in which the following data is assumed to be a part of the command language. You can switch back to the online mode by sending the O command.
The Hayes command set is modal, switching from command mode to online mode. This is not appropriate in the case where the commands and data will switch back and forth rapidly. An example of a non-modal escape sequence control language is the VT100, which used a series of commands prefixed by the Control Sequence Introducer , escape-[.
There is a fine line between a set of control characters and an escape sequence that may not exist at all. The earlier VT52 terminal used simple commands like escape-A, which is sufficiently simple to be considered a control character command language. However the VT52 also supported parameters, which a simple control language likely wouldn t.
The escape sequence was invented by Robert Bemer, first proposed in a 1960 paper for IBM called A Proposal for Character Code Compatibility . Shortly before his death, Bemer promised to edit this Wikipedia article, warning of its shortcomings (see discussion). Alas he passed away before he was able to do so.
In lieu of his entry, some relevant text from the 1960 paper follows:
:It appears impossible to reconcile the many different codes in use on paper or magnetic tape such that a particular code could be the national or international standard. Because of the wide usage of various codes they must be considered parallel standards subject to atrophy through adoption of a single superior code. A simple device that I call the escape character will allow as many separate and graded standards as there are bit combinations on any number of tracks, although it is certainly not (sensible) to have more of these than absolutely necessary.
:Given T character tracks (not feed, parity, or control tracks) there are 2 (power T) possible code combinations. Normally these are all assigned to specific characters or controls. I propose that one of these combinations, the same one for all standards, be reserved as an escape character. This is to be excluded from every such set of characters assigned.
:Regarding the choice of this character, it is unwise to use a null, or absence of punches or bits. Furthermore, it is quite possible that the physical permutation of tracks on tape will not be in direct correspondence with the bit pattern of internal storage in a computer or data-processing device. The only code that avoids these difficulties is the completely punched combination, or all ones in the bit structure.
:Let us make provision for this escape combination to interrupt normal decoding of a stream of characters. It will say, in effect, that The next T-bit combination is to be considered a numeric identifier of a particular standard . From then on, until interrupted by an escape character in that set, all combinational T-bit characters will be interpreted according to that standard. Shifting from one standard to another is therefore dynamic. A great additional advantage of such a scheme is that many messages in several different codes may be adjoined in the stream of transmission. In hardware, the escape character can be made to interrupt to set relays or other switching devices to select one of a variety of readers or decoders.
:Another way to view this mechanism is as a two-character shift symbol, comprised of a common symbol and an identifier number. If such numbers are limited to exclude the escape combination itself, then two or more escape symbols in sequence will permit a still further variety of standards (or, technically, sub-standards). This is a recursive property.|
|