From dd4e0a3b6d4d5d5117c45c44319518ef4cb1c7e4 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 24 May 2019 19:01:24 +0200 Subject: [PATCH] Actually end history search Fixes #5818. --- src/reader.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/reader.cpp b/src/reader.cpp index 58e811099..eff0bcd6b 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -3267,8 +3267,13 @@ maybe_t reader_data_t::readline(int nchars_or_0) { handle_readline_command(readline_cmd, rls); if (command_ends_history_search(readline_cmd)) { - history_search.reset(); + if (history_search.active()) { + history_search.go_to_end(); + update_command_line_from_history_search(); + history_search.reset(); + } } + rls.last_cmd = readline_cmd; } else { // Ordinary char.