Bell character

Last updated

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]

Contents

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 macOS Terminal will play the system warning sound) and also often offer a silent visual bell feature that flashes the terminal window briefly.

Representations

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 ctrl+G and displayed as ^G in caret notation. Unicode also includes characters for the visual representation of the character: U+2407SYMBOL FOR BELL and U+237EBELL SYMBOL.

In the 5-bit Baudot codes, BEL is represented by the number 11 (0x0B) when in "figures" mode. [3] The code 0x2F 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

Keyboard for the Osborne 1 Osborne 1 keyboard closeup.jpg
Keyboard for the Osborne 1

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:

echo ^G

where the ^G is produced by holding down Ctrl and typing G. On Unix the user may need to type Ctrl+V first to "quote" the ^G.

On POSIX systems, one may also use:

printf '\a'

and in the Bash shell, one may use ANSI-C quoting: [5]

echo $'\a'

An alternative is to use the tput command, which as a part of the ncurses library is available on most Unix/Linux operating systems:

tput bel

A program can get the same result by printing the BEL character to a terminal.

On modern systems this may not make a noise; it may instead make a visual indication such as flashing the screen, or do nothing at all.

See also

Related Research Articles

<span class="mw-page-title-main">ASCII</span> American character encoding standard

ASCII, abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because of technical limitations of computer systems at the time it was invented, ASCII has just 128 code points, of which only 95 are printable characters, which severely limited its scope. Many computer systems instead use Unicode, which has millions of code points, but the first 128 of these are the same as the ASCII set.

<span class="mw-page-title-main">ASCII art</span> Computer art form using text characters

ASCII art is a graphic design technique that uses computers for presentation and consists of pictures pieced together from the 95 printable characters defined by the ASCII Standard from 1963 and ASCII compliant character sets with proprietary extended characters. The term is also loosely used to refer to text-based visual art in general. ASCII art can be created with any text editor, and is often used with free-form languages. Most examples of ASCII art require a fixed-width font such as Courier for presentation.

<span class="mw-page-title-main">Baudot code</span> Pioneering five-bit character encodings

The Baudot code is an early character encoding for telegraphy invented by Émile Baudot in the 1870s. It was the predecessor to the International Telegraph Alphabet No. 2 (ITA2), the most common teleprinter code in use before ASCII. Each character in the alphabet is represented by a series of five bits, sent over a communication channel such as a telegraph wire or a radio signal by asynchronous serial communication. The symbol rate measurement is known as baud, and is derived from the same name.

In computing and telecommunication, a control character or non-printing character (NPC) is a code point in a character set that does not represent a written character or symbol. They are used as in-band signaling to cause effects other than the addition of a symbol to the text. All other characters are mainly graphic characters, also known as printing characters, except perhaps for "space" characters. In the ASCII standard there are 33 control characters, such as code 7, BEL, which rings a terminal bell.

In telecommunication, an End-of-Transmission character (EOT) is a transmission control character. Its intended use is to indicate the conclusion of a transmission that may have included one or more texts and any associated message headings.

In computer science, an escape sequence is a combination of characters that has a meaning other than the literal characters contained therein; it is marked by one or more preceding characters.

<span class="mw-page-title-main">ANSI escape code</span> Method used for display options on video text terminals

ANSI escape sequences are a standard for in-band signaling to control cursor location, color, font styling, and other options on video text terminals and terminal emulators. Certain sequences of bytes, most starting with an ASCII escape character and a bracket character, are embedded into text. The terminal interprets these sequences as commands, rather than text to display verbatim.

<span class="mw-page-title-main">Control key</span> Key on computer keyboards

In computing, a Control keyCtrl is a modifier key which, when pressed in conjunction with another key, performs a special operation. Similarly to the Shift key, the Control key rarely performs any function when pressed by itself. The Control key is located on or near the bottom left side of most keyboards, with many featuring an additional one at the bottom right.

<span class="mw-page-title-main">Computer terminal</span> Computer input/output device for users

A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. The teletype was an example of an early-day hard-copy terminal and predated the use of a computer screen by decades.

The null character is a control character with the value zero. It is present in many character sets, including those defined by the Baudot and ITA2 codes, ISO/IEC 646, the C0 control code, the Universal Coded Character Set, and EBCDIC. It is available in nearly all mainstream programming languages. It is often abbreviated as NUL. In 8-bit codes, it is known as a null byte.

<span class="mw-page-title-main">Text-based user interface</span> Type of interface based on outputting to or controlling a text display

In computing, text-based user interfaces (TUI), is a retronym describing a type of user interface (UI) common as an early form of human–computer interaction, before the advent of bitmapped displays and modern conventional graphical user interfaces (GUIs). Like modern GUIs, they can use the entire screen area and may accept mouse and other inputs. They may also use color and often structure the display using box-drawing characters such as ┌ and ╣. The modern context of use is usually a terminal emulator.

The backtick` is a typographical mark used mainly in computing. It is also known as backquote, grave, or grave accent.

A wide character is a computer character datatype that generally has a size greater than the traditional 8-bit character. The increased datatype size allows for the use of larger coded character sets.

<span class="mw-page-title-main">Esc key</span> Computer key

On computer keyboards, the Esc keyEsc is a key used to generate the escape character. The escape character, when sent from the keyboard to a computer, often is interpreted by software as "stop", and when sent from the computer to an external device marks the beginning of an escape sequence to specify operating modes or characteristics generally.

The C0 and C1 control code or control character sets define control codes for use in text by computer systems that use ASCII and derivatives of ASCII. The codes represent additional information about the text, such as the position of a cursor, an instruction to start a new line, or a message that the text has been received.

In computer data, a substitute character (␚) is a control character that is used to pad transmitted data in order to send it in blocks of fixed size, or to stand in place of a character that is recognized to be invalid, erroneous or unrepresentable on a given device. It is also used as an escape sequence in some programming languages.

On personal computers with numeric keypads that use Microsoft operating systems, such as Windows, many characters that do not have a dedicated key combination on the keyboard may nevertheless be entered using the Alt code. This is done by pressing and holding the Alt key, then typing a number on the keyboard's numeric keypad that identifies the character and then releasing Alt.

The delete control character is the last character in the ASCII repertoire, with the code 127. It is supposed to do nothing and was designed to erase incorrect characters on paper tape. It is denoted as ^? in caret notation and is U+007F in Unicode.

A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. A batch file may contain any command the interpreter accepts interactively and use constructs that enable conditional branching and looping within the batch file, such as IF, FOR, and GOTO labels. The term "batch" is from batch processing, meaning "non-interactive execution", though a batch file might not process a batch of multiple data.

In computing, tput is a standard Unix operating system command which makes use of terminal capabilities.

References

  1. "Baudot". Archived from the original on December 19, 2008. Retrieved February 1, 2009.
  2. Smith, Gil (2001). "Teletype Communication Codes" (PDF). Baudot.net. Archived (PDF) from the original on 20 August 2008. Retrieved 2008-07-11.
  3. "The Lorenz Cipher and how Bletchley Park broke it". www.codesandciphers.org.uk. Retrieved 9 July 2016.
  4. "2. Lexical analysis — Python 2.7.18 documentation". docs.python.org. Retrieved 2021-02-05.
  5. ANSI-C quoting