mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 04:41:14 -03:00
Add a clear-screen bind function to clear the screen (#10044)
This can be bound like `bind \cl clear-screen`, and is, by default In contrast to the current way it doesn't need the external `clear` command that was always awkward. Also it will clear the screen and first draw the old prompt to remove flicker. Then it will immediately trigger a repaint, so the prompt will be overwritten.
This commit is contained in:
@@ -87,9 +87,7 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod
|
||||
bind --preset $argv \el __fish_list_current_token
|
||||
bind --preset $argv \eo __fish_preview_current_file
|
||||
bind --preset $argv \ew __fish_whatis_current_token
|
||||
# ncurses > 6.0 sends a "delete scrollback" sequence along with clear.
|
||||
# This string replace removes it.
|
||||
bind --preset $argv \cl 'echo -n (clear | string replace \e\[3J ""); commandline -f repaint'
|
||||
bind --preset $argv \cl clear-screen
|
||||
bind --preset $argv \cc cancel-commandline
|
||||
bind --preset $argv \cu backward-kill-line
|
||||
bind --preset $argv \cw backward-kill-path-component
|
||||
|
||||
Reference in New Issue
Block a user