Fix ^C at commandline indicator for FreeBSD

This didn't work on platforms where tput exists but can never accept
terminfo names. This includes the current versions of FreeBSD - it
used to do both, now it doesn't. So, fall back to the old termcap names
by (tput smso; or tput so). Add check for the tput program before we
even try.
This commit is contained in:
Aaron Gyes 2016-09-01 07:30:50 -07:00
parent 2345bea5c1
commit 8ca3adaa91

View file

@ -9,7 +9,11 @@ function __fish_cancel_commandline
# #
# Set reverse fg/bg color mode, output ^C, restore normal mode, clear to EOL (to erase any # Set reverse fg/bg color mode, output ^C, restore normal mode, clear to EOL (to erase any
# autosuggestion). # autosuggestion).
echo -n (tput smso)"^C"(tput rmso)(tput el) if command -v tput
echo -ns (tput smso; or tput so) "^C" (tput rmso; or tput se) (tput el; or tput ce)
else
echo -n "^C"
end
for i in (seq (commandline -L)) for i in (seq (commandline -L))
echo "" echo ""
end end