Reputation: 6635
I am using vi-mode in irb by having a ~/.inputrc stating:
set editing-mode vi
Since I changed to ruby 1.9.3 and 2.0.0, IRB and the rails console started behaving differently.
Before I could use the left and right cursor arrow keys in insert mode and the cursor would move accordingly, staying in insert mode (like standard in vim).
Typing arrow left now deletes all characters till the end of the line and takes me right out of insert mode. I am lost, why is this happening?
UPDATE: How can I get irb to interpret the arrow keys as such and not as escape sequences?
Upvotes: 1
Views: 572
Reputation: 22365
This is because Readline is interpreting the escape characters for the cursor keys. Left cursor is ESC[D
which leaves insert mode and then deletes the rest of the line. Similarly cursor right will leave insert mode and C
hange the rest of the line, up will A
ppend to the rest of the line and down will go B
ack a word.
I believe this could be the same thing as bug #7859.
Upvotes: 0