flash(3)

flash3

Ring the (visual) bell of the terminal with curses

Part of beep(3).

Usage

#include <curses.h>

int beep(void); int flash(void);

Overview

beep and flash alert the terminal user: the former by sounding the terminal's audible alarm, and the latter by visibly attracting attention. Commonly, a terminal implements a visual bell by momentarily reversing the character foreground and background colors on the entire display; even a monochrome device can do this. These functions each attempt the other alert type if the one requested is unavailable. If neither is available, curses performs no action. Nearly all terminals have an audible alert mechanism such as a bell or piezoelectric buzzer, but only some can flash the screen.

Return value

These functions return OK on success and ERR on failure.

In ncurses, 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.

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.

Releases

83 releases since FreeBSD 2.2.2-RELEASE; the text changed 8 times.

  1. 2.2.2–3.5.1
  2. 4.0–6.2
  3. 6.3–10.4
  4. 11.0–12.4
  5. 13.0–14.1
  6. 14.2–14.4
  7. 14.5
  8. 15.0
  9. 15.1–16.0

History

SVr2 (1984) introduced beep and flash.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's man source.