Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Commit

Permalink
Bip when an “invalid” character is pressed.
Browse files Browse the repository at this point in the history
Previous commit avoids to print a non-printable character. This one just
add a “bell”/“bip” when the user did press such a character. This is a
sonor indication that something wrong happened.
  • Loading branch information
Hywan committed Jul 27, 2015
1 parent e8b8517 commit 5a83b5e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Readline/Readline.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ public function _readLine($char)
if (isset($this->_mapping[$char])) {
$this->_buffer = $this->_mapping[$char];
} elseif (false === Ustring::isCharPrintable($char)) {
Console\Cursor::bip();

return static::STATE_CONTINUE | static::STATE_NO_ECHO;
}

Expand Down

0 comments on commit 5a83b5e

Please sign in to comment.