Readline vi-mode doesn't work as expected
Problem overview
The new irb version appears to have problems with vi-mode readline (don't know about emacs-mode).
Not sure what the full extent of these problems is, but noticed a few common normal mode commands not working as expected. These include:
-
Adoes not jump to the end of the line - similarly,
Idoes not jump to the beginning of the line -
tenters insert mode instead of waiting for a character and then jumping before its first occurence after the cursor. Similarly withTandF(fappears to work correctly) -
udoesn't undo the last edit -
cis a no-op instead of waiting for a movement, then changing text between cursor and movement destination
I imagine this problem is more widespread and there are other readline functionalities that don't function as expected. All of these work as expected in irb --legacy and other readline programs (e.g. bash).
Steps to reproduce
(this is all on irb-1.2.1 installed from GitHub)
To reproduce the first issue from above, set readline to vi-mode, e.g. by modifying ~/.inputrc:
set editing-mode vi
Start irb, then enter the following sequence of keystrokes:
123<escape>BA
This results in the buffer containing the following (^ indicates cursor position):
A123
^
in normal mode, whereas irb --legacy (or another readline program like bash) would lead to
123
^
in insert mode.
Thank you for your reporting!
Memo:
- [x]
AandIare implemented by https://github.com/ruby/reline/commit/e4fc1ee0472c3cd99ae6d7b790ad003e631c65fd - [x]
t,T, andFwhat are motions...are implemented by ruby/reline#111 and ruby/reline#112 - [x]
cwhat is a kind of operator with other motion...is implemented by https://github.com/ruby/reline/pull/114 - [ ]
uwas being filed at ruby/reline#8
Here are some other things missing, tested in irb 1.4.1:
-
;and,are no-ops; should repeat the previous find action (forF+ a character) -
~is a no-op; it should change the case of the letter under the cursor -
sis a no-op; it should yank the character under the cursor and enterinsertmode -
Sis a no-op; it should yank the entire line and enterinsertmode -
Cis a no-op; it should yank text from the cursor to the end of the line and enterinsertmode -
Ris a no-op; it should enter replacement mode