curs_beep(3X)
β¨ curs_beep β the bell one π
okay so bestie, this is a page from the curses library calls manual (yes, section 3X, we're fancy π
). Let's get into it.
π NAME π
beep, flash β ring the (visual) bell of the terminal with curses
π SYNOPSIS π
#include <curses.h>
int beep(void);
int flash(void);
π¦ DESCRIPTION π¦
So beep and flash are both here to alert the terminal user, they just have different love languages π
beepdoes it by sounding the terminal's audible alarm.flashdoes it by visibly attracting attention.
Typically, a terminal pulls off a visual bell by momentarily reversing the character foreground and background colors on the entire display β and get this, even a monochrome device can do it. iconic.
Here's the cute part: these functions each attempt the other alert type if the one requested is unavailable. So they've got each other's backs π«Ά. And if neither is available? curses just does nothing, no action, periodt.
Nearly all terminals have an audible alert mechanism like a bell or a piezoelectric buzzer π, but only some can flash the screen. iykyk.
πΈ RETURN VALUE πΈ
These functions return OK on success and ERR on failure.
In ncurses specifically: beep and flash return OK if the terminal type supports the corresponding capability β bell (bel) for beep, and flash_screen (flash) for flash. Otherwise they return ERR. π
π EXTENSIONS π
In ncurses, these functions can return ERR. (yes that's the whole extension, we love a short king)
π PORTABILITY π
X/Open Curses Issue 4 describes these functions. It specifies no error conditions for them.
On SVr4 curses, they always return OK, and X/Open Curses specifies them as doing so.
so like, if you're porting and relying on ERRβ¦ bestie. different curses, different story π
π§ HISTORY π§
SVr2 (1984) introduced beep and flash. retro legends, honestly. β¨
β SEE ALSO β
curses(3X)terminfo(5)
and that's the whole page, no notes π this was ncurses 6.6, dated 2025-02-01 β mwah, slay, go ring that bell ππ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright 2018-2024,2025 Thomas E. Dickey
- Copyright 1998-2005,2010 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms