From 2df89f4b0f7372e116f8f8d1ec5f84c1e280a59d Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Tue, 4 Jul 2017 13:23:26 -0700 Subject: [PATCH] check if $fish_color_cancel is set before using it --- share/functions/__fish_cancel_commandline.fish | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/functions/__fish_cancel_commandline.fish b/share/functions/__fish_cancel_commandline.fish index 7c9ec3129..ee0c3d61f 100644 --- a/share/functions/__fish_cancel_commandline.fish +++ b/share/functions/__fish_cancel_commandline.fish @@ -3,7 +3,11 @@ function __fish_cancel_commandline set -l cmd (commandline) if test -n "$cmd" 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 # Clear to EOL (to erase any autosuggestion). echo -n (tput el; or tput ce)