Revert to not inserting control characters from keyboard input

As mentioned in the comment the historical behavior is because pressing unknown
control characters like Ctrl+4 inserts confusing characters, so let's back
out that part of b77d1d0e2 (Stop crashing on invalid Unicode input, 2024-02-27).

We still have the code for rendering control characters, for pasted text,
or text recalled from history. It is unclear whether we should strip those.
Some terminals already strip control characters from pasted text -- but not
all of them: see https://codeberg.org/dnkl/foot/pulls/312 for example which
has a follow up called "Don't strip HT when pasting in non-bracketed mode".
This commit is contained in:
Johannes Altmanninger 2024-03-02 20:30:41 +01:00
parent 2a4e776d92
commit 33a7172ee8

View file

@ -1844,6 +1844,10 @@ impl ReaderData {
&& zelf.active_edit_line().1.position() == 0
{
// This character is skipped.
} else if c.is_control() {
// This can happen if the user presses a control char we don't recognize. No
// reason to report this to the user unless they've enabled debugging output.
FLOG!(reader, wgettext_fmt!("Unknown key binding 0x%X", c));
} else {
// Regular character.
let (elt, _el) = zelf.active_edit_line();