Escape sequence can also refer to a sequence of escape characters.
An escape sequence is a series of characters used to trigger some sort of command state in computers and their attached peripherals.
An escape character which is usually assigned to the Esc key on a keyboard may be used to indicate that the next sequence is a command to be executed rather than a graphic to be displayed. The Esc key may be used as an input character in editors such as EMACS, or backing up in a menu for some applications. The Hewlett Packard HP 2640 terminals had a key for "display functions" mode which would display graphics for all control characters, include Esc to aid in debugging applications.
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-
The VT100 terminal implemented the more sophisticatd ANSI standard for functions such as controlling cursor movement, character set, and display enhancements. The Hewlett Packard HP 2640 series had perhaps the most elaborate escape sequences for block and character modes, programming keys and their soft labels, graphics vectors, and even saving data to tape or disk files.
The use of GUI operating systems which directly write to display cards have largely made the use of escape sequence, though a utility ANSI.SYS can be used to enable the interpreting of ANSI terminal escape sequences in a DOS command window in DOS or Windows, but it can still be used to create interactive random-access character based screen interfaces with the character based library routines such as printf without resorting to a GUI program.
Escape sequences date back at least to the 1874 Baudot code.
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Escape sequence".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world