BEL
BEL (Bell) is a C0 control character that signals the terminal to alert the user. Originally this triggered an audible tone on hardware terminals; modern terminal emulators typically support both audible and visual bell modes.
Syntax
BEL 0x07
BEL = 0x07 ;
Description
Per ECMA-48 §8.3.3, BEL "is used when there is a need to call for attention; it may control alarm or attention devices."
The effect of BEL is implementation-defined. On the original DEC VT100 and VT510, it sounded a hardware bell tone (if enabled in the keyboard setup). Modern terminal emulators typically offer a choice between:
- Audible bell — playing a system alert sound
- Visual bell — briefly flashing the terminal window or titlebar
- No bell — silently ignoring the character
Most terminals also set an "urgent" or "attention" hint on the window when a bell fires in a background tab or unfocused window.
Use as OSC terminator
BEL (0x07) is widely accepted as an alternative string terminator for OSC sequences in place of ST (0x9C or ESC \). This convention originated in early XTerm (X11R4, December 1989) and has become a de facto standard across virtually all modern terminal emulators. Many programs prefer BEL as the OSC terminator because it is a single byte and avoids the ambiguity of the two-byte ESC \ sequence inside certain contexts.
Examples
printf '\a' # Ring the bell (POSIX shell)
printf '\x07' # Same, using hex escape
Specifications
| Specification | Section |
|---|---|
| ECMA-48 | §8.3.3 |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✓ | Yes | Handler bell() at term/mod.rs:1437 sends Event::Bell |
| Bobcat | ✓ | 0.9.0 | Handled via WhenBell callback, audible bell implemented in Terminal.cpp:991 |
| contour | ✓ | v0.1.0 | Implemented in executeControlCode; calls Terminal::bell() |
| foot | ✓ | Yes | Implemented in vt.c:131-133, calls term_bell() |
| Ghostty | ✓ | v1.0.0 | Handled in stream.zig:767 as C0.BEL (0x07) |
| iTerm2 | ✓ | Yes | |
| Kitty | ✓ | Yes | |
| Konsole | ✓ | Yes | Emits bell signal |
| mintty | ✓ | Yes | Handled in do_ctrl() at src/termout.c:1689 |
| mlterm | ✓ | rel-0_2_1 | |
| PuTTY | ✓ | 0.45 | |
| Rio | ✓ | v0.0.28 | |
| rxvt-unicode | ✓ | rxvt-unicode-1.2 | |
| st | ✓ | 0.6 | |
| terminology | ✓ | v0.1.0 | |
| VT100 | ✓ | Yes | |
| VTE | ✓ | Yes | |
| WezTerm | ✓ | Yes | Handled in performer.rs:451 via ControlCode::Bell, triggers Alert::Bell |
| Windows Terminal | ✓ | Yes | Handled via WarningBell() dispatch method in OutputStateMachineEngine.cpp:56-57 |
| xterm | ✓ | Yes | Implemented in charproc.c:3685. Visual/audible bell via Bell() function |
| xterm.js | ✓ | 2.3.0 | |
| Multiplexers | |||
| cy | ✓ | v0.1.0 | Handler present but no actual bell output |
| GNU Screen | ✓ | v.4.2.0 | Implemented in Special() function at src/ansi.c:691 |
| tmux | ✓ | 0.8 | Triggers window bell alert via alerts_queue() |
| tuios | ✓ | v0.0.15 | |
| Zellij | ✓ | v0.24.0 | |
See also
- OSC 0 — Set Icon Name and Window Title — Uses BEL as a common string terminator