Skip to content

Commit

Permalink
Don't clear scrollback with the \cl binding
Browse files Browse the repository at this point in the history
ncurses since 6.0 sends the "E3" sequence along with "clear", even for
just `clear` or `tput clear`. This deletes the scrollback buffer which
is usually not what you want.

Fixes fish-shell#2855.
  • Loading branch information
faho authored and develop7 committed Apr 17, 2017
1 parent c1dbc95 commit f7e8158
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions 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).

---

Expand Down
4 changes: 3 additions & 1 deletion share/functions/__fish_shared_key_bindings.fish
Expand Up @@ -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
Expand Down

0 comments on commit f7e8158

Please sign in to comment.