mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 20:21:16 -03:00
Make any character insertion end history search
Currently, if you enter `echo` and press up-arrow, it might select
e.g. `echo foo`.
You can then enter text, making it `echo foobar` and press up-arrow
again, but the search string is *still* `echo`.
Many *other* input functions will end history search, including e.g.
expand-abbr, so pressing space by default will already end it.
So this ends the history search once you input something.
Incidentally this allows suggestions to work in this case, so it
Fixes #10287
Note that autosuggestions have been disabled while history search is
active since a08450bcb6, I'm not sure
it's actually *needed*, so it would also be possible to enable it in
that case.
But since this is already awkward (history search is *active* but with
the old search string) and I'm not sure if e.g. suggestions during
history search would be too busy, let's do this first.
This commit is contained in:
@@ -1859,6 +1859,8 @@ fn readline(&mut self, nchars: Option<NonZeroUsize>) -> Option<WString> {
|
||||
|
||||
if elt == EditableLineTag::Commandline {
|
||||
zelf.clear_pager();
|
||||
// We end history search. We could instead update the search string.
|
||||
zelf.history_search.reset();
|
||||
}
|
||||
} else {
|
||||
// This can happen if the user presses a control char we don't recognize. No
|
||||
|
||||
Reference in New Issue
Block a user