A bell code (sometimes bell character) is a device
control code
In computing and telecommunication, a control character or non-printing character (NPC) is a code point (a number) in a character set, that does not represent a written symbol. They are used as in-band signaling to cause effects other than the ...
originally sent to ring a small electromechanical bell on
tickers and other
teleprinter
A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point and point-to-multipoint configurations. Initia ...
s 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
Tape or Tapes may refer to:
Material
A long, narrow, thin strip of material (see also Ribbon (disambiguation):
Adhesive tapes
* Adhesive tape, any of many varieties of backing materials coated with an adhesive
* Athletic tape, pressure-sensiti ...
, 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
Baudot code
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 until the advent of ASCII. ...
).
To maintain backward compatibility, video display
terminal
Terminal may refer to:
Computing Hardware
* Terminal (electronics), a device for joining electrical circuits together
* Terminal (telecommunication), a device communicating over a line
* Computer terminal, a set of primary input and output devic ...
s (VDTs) that replaced teletypewriters included speakers or buzzers to perform the same function, as did the personal computers that followed. Modern
terminal emulator
A terminal emulator, or terminal application, is a computer program that emulates a video terminal within some other display architecture. Though typically synonymous with a shell or text terminal, the term ''terminal'' covers all remote termin ...
s often integrate the warnings to the desktop environment (e.g., the
macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
Terminal
Terminal may refer to:
Computing Hardware
* Terminal (electronics), a device for joining electrical circuits together
* Terminal (telecommunication), a device communicating over a line
* Computer terminal, a set of primary input and output devic ...
will play the system warning sound) and also often offer a silent ''visual bell'' feature that flashes the terminal window briefly.
Representations
In
ASCII
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 ...
and
Unicode
Unicode, formally The Unicode Standard,The formal version reference is is an information technology Technical standard, standard for the consistent character encoding, encoding, representation, and handling of Character (computing), text expre ...
the character with the value 7 is BEL. It can be referred to as control-G or in
caret notation
Caret notation is a notation for control characters in ASCII. The notation assigns to control-code 1, sequentially through the alphabet to assigned to control-code 26 (0x1A). For the control-codes outside of the range 1–26, the ...
. Unicode also includes a character for the visual representation of the bell code, "symbol for bell" (␇) at
U+2407
, and graphic for the control code (⍾) at
U+237E
.
In the 5-bit Baudot codes, BEL is represented by the number 11 (
0x0B
) when in "figures" mode.
In the programming languages
C (created in 1972) and
Python
Python may refer to:
Snakes
* Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia
** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia
* Python (mythology), a mythical serpent
Computing
* Python (pro ...
(created in 1991), 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
Backspace () is the keyboard key that originally pushed the typewriter carriage one position backwards and in modern computer systems moves the display cursor one position backwards,"Backwards" means to the left for left-to-right languages. delete ...
character.)
Usage
![Osborne 1 keyboard closeup](https://upload.wikimedia.org/wikipedia/commons/4/40/Osborne_1_keyboard_closeup.jpg)
On
Unix-like
A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
systems, or on
MS-DOS
MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few ope ...
or
Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
, a user can cause the equivalent of ringing the bell to happen by typing at the
command prompt
Command Prompt, also known as cmd.exe or cmd, is the default command-line interpreter for the OS/2, eComStation, ArcaOS, Microsoft Windows (Windows NT family and Windows CE family), and ReactOS operating systems. On Windows CE .NET 4.2, Wind ...
the command:
echo ^G
where the is produced by holding down and typing . On Unix the user may need to type + first to "quote" the .
On POSIX systems, one may also use:
printf '\a'
and in the
Bash
Bash or BASH may refer to:
Arts and entertainment
* ''Bash!'' (Rockapella album), 1992
* ''Bash!'' (Dave Bailey album), 1961
* '' Bash: Latter-Day Plays'', a dramatic triptych
* ''BASH!'' (role-playing game), a 2005 superhero game
* "Bash" ('' ...
shell, one may use ANSI-C quoting:
ANSI-C quoting
/ref>
echo $'\a'
An alternative is to use the tput
In computing, tput is a standard Unix operating system command which makes use of terminal capabilities.
Depending on the system, ''tput'' uses the terminfo or termcap database, as well as looking into the environment for the terminal type.
His ...
command, which as a part of the ncurses
ncurses (new curses) is a programming library providing an application programming interface (API) that allows the programmer to write text-based user interfaces (TUI) in a terminal-independent manner. It is a toolkit for developing "GUI-like" ...
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
* C0 and C1 control codes
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, ...
(ISO 646
ISO/IEC 646 is a set of ISO/IEC standards, described as ''Information technology — ISO 7-bit coded character set for information interchange'' and developed in cooperation with ASCII at least since 1964. Since its first edition in 1 ...
)
References
ATIS Telcom Glossary
Free On-Line Dictionary of Computing, 'bell'
{{DEFAULTSORT:Bell Character
Control characters