Why does irb paste control characters into my reverse interactive search buffer?

If I do a reverse interactive search in irb, then enter a control character (the arrow keys are the only ones I've seen with this). Therefore, I start with this session:

$ irb
>> print "hello"
hello

then enter ^r,h

$ irb
>> print "hello"
hello
(reverse-i-search)`he': print "hello"

So far so good. Then I press the left arrow, and in the end I get the following:

$ irb
>> print "hello"
hello
>> print "[Dhello"

Subsequent use of the arrows usually moves the cursor.

+5
source share
2 answers

This will not solve your problem, but at least I can answer your question (why):

, ESC, [ D. ( , read , ^[[D, ^[ escape.)

- irb ESC, ; ESC , [D . readline, Bash Python , ledit (, - ^^) .

- , , , ESC . , , .

+3

vi?

~  $ irb
1.9.3p392 :001 > Readline.vi_editing_mode?
  => true

$HOME/.inputrc set editing-mode vi. "" .

@JoLiss, readline (bash ..) ; AFAICT, Ruby. .: http://bugs.ruby-lang.org/issues/7859#change-36333

+1

All Articles