mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 00:01:15 -03:00
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:
@@ -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
|
||||
# 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))
|
||||
echo ""
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user