A bell character (sometimes bell code) is a device control code originally sent to ring a small electromechanical bell on tickers and other teleprinters and teletypewriters to alert operators at the other end of the line, often of an incoming message. Though tickers punched the bell codes into their tapes,[1] printers generally do not print a character when the bell code is received. Bell codes are usually represented by the label "BEL". They have been used since 1870 (initially in the Baudot code).[2]
To maintain backward compatibility, video display terminals (VDTs) that replaced teletypewriters included speakers or buzzers to perform the same function, as did the personal computers that followed. Modern terminal emulators often integrate the warnings to the desktop environment (e.g., the macOSTerminal will play the system warning sound) and also often offer a silent visual bell feature that flashes the terminal window briefly.
In ASCII the bell character's value is 7 and is named "BELL" or "BEL". Unicode does not give names to control characters but has assigned it the alias "ALERT" and abbreviation "BEL." It can sometimes be typed as Шаблон:Keypress and displayed as Шаблон:Mono in caret notation. Unicode also includes characters for the visual representation of the character: Шаблон:Unichar and Шаблон:Unichar.
In the 5-bit Baudot codes, BEL is represented by the number 11 (0x0B) when in "figures" mode.[3] The code Шаблон:Mono is used in EBCDIC.
In the programming language C (created in 1972), and in many languages influenced by it such as Python, the bell character can be placed in a string or character constant with \a. 'a' stands for "alert" or "audible" and was chosen because \b was already used for the backspace character.[4]
Usage
On Unix-like systems, or on MS-DOS or Windows, a user can cause the equivalent of ringing the bell to happen by typing at the command prompt the command: