mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-28 12:13:55 +08:00
reader: Don't handle escape specially
Escape is just another ordinary character that you can bind, or not.
This commit is contained in:
parent
dd4e0a3b6d
commit
1fd627ebd3
|
@ -3278,16 +3278,8 @@ maybe_t<wcstring> reader_data_t::readline(int nchars_or_0) {
|
|||
} else {
|
||||
// Ordinary char.
|
||||
wchar_t c = event_needing_handling->get_char();
|
||||
if (c == L'\x1B') {
|
||||
// Escape was pressed.
|
||||
if (history_search.active()) {
|
||||
history_search.go_to_end();
|
||||
update_command_line_from_history_search();
|
||||
history_search.reset();
|
||||
}
|
||||
assert(!history_search.active());
|
||||
} else if (!fish_reserved_codepoint(c) && (c >= L' ' || c == L'\n' || c == L'\r') &&
|
||||
c != 0x7F) {
|
||||
if (!fish_reserved_codepoint(c) && (c >= L' ' || c == L'\n' || c == L'\r') &&
|
||||
c != 0x7F) {
|
||||
// Regular character.
|
||||
editable_line_t *el = active_edit_line();
|
||||
insert_char(active_edit_line(), c);
|
||||
|
|
Loading…
Reference in New Issue
Block a user