diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ff1b1ac4..1ad479cd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # fish 2.6.0 (released ???) - The `read` command now has a default limit of 10 MiB. If a line is longer than that it will fail with $status set to 122 and the var will be empty. You can set a different limit by setting the FISH_READ_BYTE_LIMIT variable. +- The \cl binding no longer deletes the scrollback buffer with ncurses >= 6.0 (#2855). --- diff --git a/share/functions/__fish_shared_key_bindings.fish b/share/functions/__fish_shared_key_bindings.fish index 9230c60a9..8282afa81 100644 --- a/share/functions/__fish_shared_key_bindings.fish +++ b/share/functions/__fish_shared_key_bindings.fish @@ -77,7 +77,9 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod bind $argv \el __fish_list_current_token bind $argv \ew 'set tok (commandline -pt); if test $tok[1]; echo; whatis $tok[1]; commandline -f repaint; end' - bind $argv \cl 'clear; commandline -f repaint' + # ncurses > 6.0 sends a "delete scrollback" sequence along with clear. + # This string replace removes it. + bind $argv \cl 'clear | string replace \e\[3J ""; commandline -f repaint' bind $argv \cc __fish_cancel_commandline bind $argv \cu backward-kill-line bind $argv \cw backward-kill-path-component