Close the completions pager (if it's open) on ctrl+c

If you're using the old binding that only clears the commandline and
doesn't preserve its contents and start a new line, you can use

```fish
bind \cc "commandline -f cancel; commandline ''"
```

instead.

Closes #4298.
This commit is contained in:
Mahmoud Al-Qudsi 2018-10-15 13:32:59 -05:00
parent d22446f651
commit c02bf2548f

View file

@ -1,5 +1,8 @@
# This is meant to be bound to something like \cC. # This is meant to be bound to something like \cC.
function __fish_cancel_commandline function __fish_cancel_commandline
# Close the pager if it's open (#4298)
commandline -f cancel
set -l cmd (commandline) set -l cmd (commandline)
if test -n "$cmd" if test -n "$cmd"
commandline -C 1000000 commandline -C 1000000