1

bash -p shows

"x\000": self-insert

May be that this came in by a typo.

In order to repair, a normal bind command

bind "x":self-insert

or

bind '"x":self-insert'

has no effect. Therefore I try to remove the false binding by

bind -r "x\000"

It does effect nothing.

I have tried all variations with quotes and backslashes and $'\x00' and the like ('\0'), e.g.

bind -r "x"'\0'

without succsess.

But this was the solution --,for the first time:

bind -r ' "x" "$(echo -n -e "\x00")" '

For a second equal case this did not work.

The second case was because the normal command

bind '"x":self-insert'

caused again that bash -p shows

"x\000": self-insert

Is there really no unmistakenp way?

=====

== edit 08.12.2022 16:05

Thanks, but I need a way not to close the shell in order not to loose things.

. inputrc or other initiating files are not affected.

With my solution presented in the answer the unwanted binding is removed succsessfully.

The question now is how to make a new correct binding.

Even

bind "$(echo -n -e "\0170")":self-insert

is no wsy. All what I do results in

bash -p shows

"x\000": self-insert

I cannot ask you to help because you do not have such a corrupted shell.

( I do not have the courage to speculate if this is another craziness of bash )

Regards

Anton Wessel

2
  • 1
    If there is an unwanted binding in some interactive shell, then closing the shell and opening a new one may help and it's the easiest solution. If the unwanted binding affects the new shell, it means the binding is in ~/.inputrc or (as bind …) in ~/.bashrc or so (or in one of their global counterparts in /etc). In this case you probably want to fix the responsible file rather than bind -r in just one shell, because bind -r only affects the shell you run it from and does not affect the permanent config. Commented Dec 8, 2022 at 8:54
  • Other things to try next time: use the quoted-insert char (C-q or C-v) before typing x to get it taken literally. Or switch off readline with set +o emacs +o vi.
    – meuh
    Commented Dec 9, 2022 at 7:53

1 Answer 1

0

The solution to is

bind -r "x" "$(echo -n -e "\x00")"

The problem why

 bind '"x":self-insert'

caused again that bash -p shows

"x\000": self-insert

is not yet solved. The reason is that I have not in this command to type "x" literally but in octal or decimal (in hex it cannot work because there "x" is involved).

I am trying how to insert "x" in decimal.

1
  • The output of a command doesn't have to be a syntactically correct input to the shell command interpreter. Consult bash(1) (man bash). Commented Dec 8, 2022 at 10:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .