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

bind prints raw control characters when no slash-escape exists for it #7631

lilyball opened this issue Jan 15, 2021 · 1 comment
bug Something that's not working as intended


Copy link

lilyball commented Jan 15, 2021

The default set of binds includes a binding on the del control character.

bind --preset $argv \x7f backward-delete-char

But when you ask bind to then print its bindings, it just prints the del control character raw:

bind --preset -k backspace backward-delete-char
bind --preset  backward-delete-char
bind --preset -k sdc backward-delete-char

(piping that into less will show the control character as a highlighted ^?)

bind should instead show any non-printable character as a hex or unicode escape, if there's no key name for it. Though in this particular case maybe it should just show it as \c?, which is a bit confusing and generally can't be typed but is technically accurate.

fish, version 3.1.2

Copy link

faho commented Jan 16, 2021

bind calls escape_string_script here, which string escape also uses, so that would need to be adjusted.

I'd just make it so DEL ends up being shown as \x7f. That's as likely to be of use as \c?, and is what we actually use in the binding scripts.

I'm not sure if any other characters need this adjustment as well - all control characters?

But since the immediate issue is with DEL, let's do that first.

@faho faho closed this as completed in 932074f Jan 16, 2021
@faho faho added the bug Something that's not working as intended label Jan 16, 2021
@faho faho added this to the fish 3.2.0 milestone Jan 16, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
bug Something that's not working as intended
None yet

No branches or pull requests

2 participants