Allow customization of ^C with a new color variable#3963
Conversation
| echo -ns (set_color -r) "^C" (set_color normal) (tput el; or tput ce) | ||
| else | ||
| echo -n "^C" | ||
| # Clear to EOL (to erase any autosuggestion). |
There was a problem hiding this comment.
This is orthogonal to the documented reason for this change and is going to be controversial.
There was a problem hiding this comment.
Is it possible you misconstrued the diff? This feature was present before too; check out the comment at old line 10.
I just extracted the ^C echoing out of the conditional statement since it's independent of tput availability. It was apparently written that way initially because tput was used instead of set_color, but it was changed in 1fb92b6.
There was a problem hiding this comment.
Yes, you are correct. I was misreading the diff.
| else | ||
| echo -n "^C" | ||
| # Clear to EOL (to erase any autosuggestion). | ||
| echo -n (tput el; or tput ce) |
There was a problem hiding this comment.
Shouldn't this be echo -n (tput el ^/dev/null; or tput ce)? After all, if el isn't legal an error is going to be written to stderr.
There was a problem hiding this comment.
I think so... I'm not familiar with terminfo, though.
|
See the file doc_src/index.hdr.in for where the color vars are documented. |
|
Squash merged as commit 349eff0. Thanks. |
Description
I've modified the
__fish_cancel_commandlinefunction to print^Cusing a color defined in a newfish_color_cancelvariable.I've set the default value of this variable to
-rto match the current behaviour.Please let me know if there's anywhere I should add documentation. I looked but didn't find the other color variables documented anywhere.
TODOs: