0

To source my ~/.inputrc, I've tried C-x C-c and bind -f ~/.inputrc. I'm out of ideas, even after reading the man bash section on bind.


I have "\C-Rubout": backward-kill-word in my ~/.inputrc. But when I query bash with bind -q backward-kill-word, I don't get the output I expect:

$ bind -q backward-kill-word
backward-kill-word can be invoked via "\C-rubout", "\e\C-h", "\e\C-?".

I think that the wrong capitalization in rubout might be an issue, but no matter how I change my ~/.inputrc file, I can't get it to work!!

I'm struggling to find a good resource to help me learn how to become less incompetent at the bind part of bash... The results I'm getting seem erroneous, but I know better than to be confident about that until I know more about this stuff.


I've read through the gnu manual, and tried using \b, \d, and \177 in lieu of Rubout, but none of those worked. The one in the gnu manual (here) was pretty neat.

1 Answers1

0

The default binding was not present in terminal. I needed to add "\C-x\C-r": re-read-init-file to my ~/.inputrc.

Re-reading an init file will not cause currently bound commands to go away. I was wrong to assume that deleting a line from my ~/.inputrc then calling bind -f ~/.inputrc would unbind said binding. Thus, This command actually DOES work at re-reading my init file.


I was troubleshooting poorly. Since my basics didn't work, all my knowledge was shaky. I was not re-sourcing my readline file, I was re-reading. This is a KEY difference

Additionally, binding a command multiple times in the same file seems to discard all but the last definition. All of my issues with troubleshooting led me to just give up.

Finally, I didn't know that there's both unix-word-rubout and backward-kill-word. They're 2 distinct commands, but they act the same on my terminal.


I realized that I could figure out how to represent delete by looking at a command that was bound to delete.:

$ bind -q backward-kill-word
backward-kill-word can be invoked via "\e\C-h", "\e\C-?".

My terminal converts delete differently than other terminals, I guess... I thought that ? was a placeholder for "I am unable to represent this", but that's ! I really just needed to use a literal ?, ASCII code 63.

Anyway, when I placed "\C-?": unix-word-rubout in my ~/.inputrc, everything worked perfectly :)