mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
check if $fish_color_cancel is set before using it
This commit is contained in:
parent
e4aedcd22c
commit
2df89f4b0f
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue