I've set up my bash in iTerm2 on Mac so that Option+Left goes backward a word, and Option+Right goes forward a word. I've done this to have a similar setup as on my Linux machine.
However, sometimes the setup stops working, and when I press Option+Left, the cursor doesn't jump a word backwards, but adds the string ;9D to the command line input. Option+Right then adds ;9C.
When open a new terminal, Option+Left/Right work correctly, only sometimes this incorrect behavior occurs. I have not yet figured out what causes this. Typing reset does not fix the issue, re-loading my bash config with source .bashrc doesn't fix the issue either.
My questions are:
- What is causing the Option+Left/Right shortcuts from working sometimes?
- How can I fix this so it doesn't happen again?
This is my .inputrc:
"\e\e[D": backward-word
"\e\e[C": forward-word

