diff --git a/src/terminal.rs b/src/terminal.rs index 49f413b1..2a45c673 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -154,6 +154,17 @@ pub fn window_size() -> io::Result { sys::window_size() } +/// Instructs the terminal to give an alert. +/// +/// # Notes +/// +/// Typically this is a bell sound, but may also be a visual alert such as a screen flash. +/// +/// See [Wikipedia](https://en.wikipedia.org/wiki/Bell_character). +pub fn bell() { + print!("{}", 0x07 as char); +} + /// Disables line wrapping. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct DisableLineWrap;