check if $fish_color_cancel is set before using it

This commit is contained in:
Kurtis Rader 2017-07-04 13:23:26 -07:00
parent e4aedcd22c
commit 2df89f4b0f

View file

@ -3,7 +3,11 @@ function __fish_cancel_commandline
set -l cmd (commandline) set -l cmd (commandline)
if test -n "$cmd" if test -n "$cmd"
commandline -C 1000000 commandline -C 1000000
echo -ns (set_color $fish_color_cancel) "^C" (set_color normal) if set -q fish_color_cancel
echo -ns (set_color $fish_color_cancel) "^C" (set_color normal)
else
echo -ns "^C"
end
if command -sq tput if command -sq tput
# Clear to EOL (to erase any autosuggestion). # Clear to EOL (to erase any autosuggestion).
echo -n (tput el; or tput ce) echo -n (tput el; or tput ce)