2016-04-14 10:46:18 +08:00
|
|
|
# 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
|
2017-07-05 04:23:26 +08:00
|
|
|
if set -q fish_color_cancel
|
|
|
|
echo -ns (set_color $fish_color_cancel) "^C" (set_color normal)
|
|
|
|
else
|
|
|
|
echo -ns "^C"
|
|
|
|
end
|
2016-12-31 22:12:05 +08:00
|
|
|
if command -sq tput
|
2017-04-11 11:28:26 +08:00
|
|
|
# Clear to EOL (to erase any autosuggestion).
|
|
|
|
echo -n (tput el; or tput ce)
|
2016-09-01 22:30:50 +08:00
|
|
|
end
|
2016-04-14 10:46:18 +08:00
|
|
|
for i in (seq (commandline -L))
|
|
|
|
echo ""
|
|
|
|
end
|
|
|
|
commandline ""
|
|
|
|
commandline -f repaint
|
|
|
|
end
|
|
|
|
end
|