Skip to content

Commit d2f532f

Browse files
committed
Add documentation for BELL signal
1 parent 7cfb2a1 commit d2f532f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ without requiring any extensions or special installation.
2424
* [History](#history)
2525
* [Autocomplete](#autocomplete)
2626
* [Keys](#keys)
27+
* [Bell](#bell)
2728
* [Readline](#readline)
2829
* [Pitfalls](#pitfalls)
2930
* [Install](#install)
@@ -534,6 +535,23 @@ $stdio->on("\033[A", function () use ($stdio) {
534535
});
535536
```
536537

538+
#### Bell
539+
540+
By default, this project will emit a audible/visible BELL signal when the user
541+
tries to execute an otherwise disabled function, such as using the
542+
<kbd>left</kbd> or <kbd>backspace</kbd> keys when already at the beginning of the line.
543+
544+
Whether or not the BELL is audible/visible depends on the termin and its
545+
settings, i.e. some terminals may "beep" or flash the screen or emit a short
546+
vibration.
547+
548+
The `setBell(bool $bell): void` method can be used to
549+
enable or disable emitting the BELL signal when using a disabled function:
550+
551+
```php
552+
$stdio->setBell(false);
553+
```
554+
537555
### Readline
538556

539557
The deprecated `Readline` class is responsible for reacting to user input and

0 commit comments

Comments
 (0)