diff options
author | Kurtis Rader <krader@skepticism.us> | 2016-04-13 19:46:18 -0700 |
---|---|---|
committer | Kurtis Rader <krader@skepticism.us> | 2016-04-14 20:57:04 -0700 |
commit | 5f849d02646b60943557b00b51a0e592c2387959 (patch) | |
tree | 872baacf4db97456bb596ce19be61fefcc9549c1 /share/functions/__fish_cancel_commandline.fish | |
parent | 671c0515d4212f3cf37eccc080527c42eec7d060 (diff) |
provide a better experience when user presses \cC
Fixes #2904
Diffstat (limited to 'share/functions/__fish_cancel_commandline.fish')
-rw-r--r-- | share/functions/__fish_cancel_commandline.fish | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/share/functions/__fish_cancel_commandline.fish b/share/functions/__fish_cancel_commandline.fish new file mode 100644 index 00000000..f10be75f --- /dev/null +++ b/share/functions/__fish_cancel_commandline.fish @@ -0,0 +1,13 @@ +# This is meant to be bound to something like \cC. +function __fish_cancel_commandline + set -l cmd (commandline) + if test -n "$cmd" + commandline -C 1000000 + echo (set_color -b bryellow black)"^C"(set_color normal) + for i in (seq (commandline -L)) + echo "" + end + commandline "" + commandline -f repaint + end +end |