diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0d3633c16..8ff9d8661 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -24,6 +24,7 @@ Interactive improvements - Using ``fish_vi_key_bindings`` in combination with fish's ``--no-config`` mode works without locking up the shell (:issue:`9443`). - The history pager now uses more screen space, usually half the screen (:issue:`9458`) - Variables that were set while the locale was C (i.e. ASCII) will now properly be encoded if the locale is switched (:issue:`2613`, :issue:`9473`). +- Escape during history search restores the original commandline again (regressed in 3.6.0). New or improved bindings ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/reader.cpp b/src/reader.cpp index 1df9b509c..e66c7b500 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -4482,7 +4482,8 @@ maybe_t reader_data_t::readline(int nchars_or_0) { // Clear the pager if necessary. bool focused_on_search_field = (active_edit_line() == &pager.search_field_line); - if (command_ends_paging(readline_cmd, focused_on_search_field)) { + if (!history_search.active() && + command_ends_paging(readline_cmd, focused_on_search_field)) { clear_pager(); } diff --git a/tests/checks/tmux-history-search.fish b/tests/checks/tmux-history-search.fish index 9dc1b4fd1..92bab0b80 100644 --- a/tests/checks/tmux-history-search.fish +++ b/tests/checks/tmux-history-search.fish @@ -3,6 +3,9 @@ # disable on github actions because it's flakey #REQUIRES: test -z "$CI" +set -g isolated_tmux_fish_extra_args -C ' + set -g fish_autosuggestion_enabled 0 +' isolated-tmux-start isolated-tmux send-keys 'true needle' Enter @@ -15,3 +18,12 @@ isolated-tmux send-keys C-p C-a M-f M-f M-f M-. # CHECK: prompt 2> true hay needle hay tmux-sleep isolated-tmux capture-pane -p + +isolated-tmux send-keys C-e C-u true Up Up Escape +tmux-sleep +isolated-tmux capture-pane -p | grep 'prompt 2' +# CHECK: prompt 2> true +isolated-tmux send-keys C-z _ +tmux-sleep +isolated-tmux capture-pane -p | grep 'prompt 2' +# CHECK: prompt 2> _