diff --git a/CHANGELOG.rst b/CHANGELOG.rst index eda5a8a63..26aa801da 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,10 @@ fish ?.?.? (released ???) ========================= +Interactive improvements +------------------------ +- :kbd:`ctrl-l` no longer cancels history search (:issue:`12436`). + Regression fixes: ----------------- - (from 4.4.0) Vi mode ``d,f`` key binding (:issue:`12417`). diff --git a/src/reader/reader.rs b/src/reader/reader.rs index 60a74a2c7..324c09587 100644 --- a/src/reader/reader.rs +++ b/src/reader/reader.rs @@ -6268,6 +6268,8 @@ fn command_ends_history_search(c: ReadlineCmd) -> bool { | rl::HistoryPagerDelete | rl::BeginningOfHistory | rl::EndOfHistory + | rl::ScrollbackPush + | rl::ClearScreenAndRepaint | rl::Repaint | rl::ForceRepaint ) diff --git a/tests/pexpects/history.py b/tests/pexpects/history.py index dd0be4289..ac221a961 100644 --- a/tests/pexpects/history.py +++ b/tests/pexpects/history.py @@ -154,6 +154,20 @@ expect_prompt() send("\x1b[A") expect_re("echo TERM") # not ephemeral! +# Verify that ctrl-l preserves an active up-arrow history search +sendline("echo __ctrl_l_history_a") +expect_prompt("__ctrl_l_history_a") +sendline("echo __ctrl_l_history_b") +expect_prompt("__ctrl_l_history_b") +send("__ctrl_l_history") +send("\x1b[A") +expect_re("echo __ctrl_l_history_b") +send("\f") +send("\x1b[A") +expect_re("echo __ctrl_l_history_a") +sendline("") +expect_prompt("__ctrl_l_history_a") + # Verify that clear-session works as expected # Note: This test depends on that history merge resets the session from history clear-sessions point of view. sendline("builtin history clear")