Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customization of ^C with a new color variable #3963

Closed
wants to merge 3 commits into from

Conversation

@frangio
Copy link
Contributor

@frangio frangio commented Apr 17, 2017

Description

I've modified the __fish_cancel_commandline function to print ^C using a color defined in a new fish_color_cancel variable.

I've set the default value of this variable to -r to 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:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.md
@frangio frangio changed the title Cancel color Allow customization of ^C with a new color variable Apr 17, 2017
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).

This comment has been minimized.

@krader1961

krader1961 Apr 17, 2017
Contributor

This is orthogonal to the documented reason for this change and is going to be controversial.

This comment has been minimized.

@frangio

frangio Apr 18, 2017
Author Contributor

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.

This comment has been minimized.

@krader1961

krader1961 Apr 18, 2017
Contributor

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)

This comment has been minimized.

@krader1961

krader1961 Apr 17, 2017
Contributor

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.

This comment has been minimized.

@frangio

frangio Apr 18, 2017
Author Contributor

I think so... I'm not familiar with terminfo, though.

@krader1961
Copy link
Contributor

@krader1961 krader1961 commented Apr 17, 2017

See the file doc_src/index.hdr.in for where the color vars are documented.

@krader1961
Copy link
Contributor

@krader1961 krader1961 commented Apr 18, 2017

Squash merged as commit 349eff0. Thanks.

@krader1961 krader1961 closed this Apr 18, 2017
@zanchey zanchey added this to the fish 2.6.0 milestone Aug 19, 2017
@frangio frangio deleted the frangio:cancel-color branch May 9, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.