I'm trying to remap keys on the bash command line. I have a .inputrc file which I have reduced to:
"\C-w": forward-word There were other settings, but I have reduced them to one for the sake of question clarity.
What happens is that on every new line in the shell, C-w resets to its default binding, unix-word-rubout. I can reload the .inputrc file with C-x C-r as I edit the line and C-w takes on the action I have assigned to it, forward-word. Then on the next line in bash, it resets to unix-word-rubout again.
If I run
> bind -P | grep C-w I get
unix-word-rubout can be found on "\C-w". But if I run
> bind -P | grep C-w and then reload .inputrc with C-x C-r before I hit enter, I get
forward-word can be found on "\C-w", "\ef". So I can load .inputrc just fine and bash even acknowledges it. But it reloads the default settings on each and every new line.
JLine, the Java Readline clone doesn't have any problems using my .inputrc as intended.
I'm running bash on OS/X Yosemite. I'm running the Homebrew 4.4.12 version, but the Apple 3.2.57 version (from 2007) works exactly the same. It works the same in Terminal.app and iTerm2.
I'd like my settings to work on every line. How can I make them persist?
.inputrcand verify that it still behaves this way? (2) What is the value of$PROMPT_COMMANDand$PS1?PROMPT_COMMANDyou may find my Apple stack exchange question and research interesting, though it isn't about.inputrcmisbehaving.)PS1='>'the issue works exactly the same.set | grep PROMPT_COMMANDshows no matches.