Bash – did the “d” break when I screwed up a bind

bashbashrcinputrc

I was swapping some readline settings in my .bashrc earlier today and mistyped the following (bind since it's not in .inputrc):

bind "mark-symlinked-directories on"

I forgot to put a set in there before mark-symlinked-directories, the end result of which was that my "d" key stopped working in the terminal. Lame. Some messing around with other bindings indicated that whatever the first letter of the last "word" was would be unusable, i.e.,

bind "page-completions off" messed up c

bind "visible-stats on" messed up s

bind "completion-query-items 42" messed up i

My question is why? What is bind doing that renders those keys useless, and why that specific key?

Best Answer

While I cannot provide an answer why this happens, it seems that if the 1st token of the readline command contains one or several dashs (-), then the character following the last dash will be unbound from the self-insert command.

e.g. the following will disable the p key.

bind foo-bar-paz zill-honk
Related Question