mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 09:28:31 +08:00
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:
parent
2a4e776d92
commit
33a7172ee8
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user