hoaproject / Console

The Hoa\Console library.
https://hoa-project.net/
366 stars 32 forks source link

Print character only if printable #49

Closed Hywan closed 9 years ago

Hywan commented 9 years ago

Fix #16 and #17.

When a character is not printable, the readline did still print it. In some cases, it could create weird bug (see 1 or 2). Since we have the Hoa\Ustring::isCharPrintable, we can check whether a character is printable or not. Consequently, here is the new logic:

So, if we would like to support a control character that is not printable, we must associate a mapping to this character (like we do for Ctrl-A for instance).

Hywan commented 9 years ago

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.

Hywan commented 9 years ago

Asking a review from @hoaproject/hoackers :-).

vonglasow commented 9 years ago

:+1: