From 8ca3adaa9133500e54ef4551ee194824f24e368e Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Thu, 1 Sep 2016 07:30:50 -0700 Subject: [PATCH] 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. --- 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 e48d32ad8..3071f0a79 100644 --- a/share/functions/__fish_cancel_commandline.fish +++ b/share/functions/__fish_cancel_commandline.fish @@ -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