Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When bash has vi bindings available (set -o vi), up/down arrows work in both command and insertion mode. When I setup readline's ~/.inputrc to use vi mode (set editing-mode vi), applications like irb don't get the arrow functionality. I've tried "set enable-keypad on" in inputrc to no effect.

How do I get bash-like arrow functionality in other readline aware applications?

share|improve this question
    
Did you figure this out by any chance? :) –  Gerald Kaszuba May 3 '12 at 4:50
    
This seems like a bug just in Ruby 1.9's IRB Readline support, because the arrow keys work elsewhere (interactive Python shell, using rlwrap with SBCL, Ruby 1.8 IRB, etc) –  atomicules Sep 18 '12 at 8:33

2 Answers 2

It seems to be an issue only with Ruby's readline (and it's still there).

I deal with it by skipping set editing-mode vi if we're using ruby's readline:

$if ruby
$else
  set editing-mode vi

  ...

$endif

There's not really anything else to do unless ruby's readline gets fixed.

share|improve this answer

So far, the only way I've been able to use the up/down arrow keys for history is to press ESC first.

This also works with the j and k keys, as long as ESC is pressed first.

share|improve this answer
    
I find j & k to be a LOT easier to type than the up/down arrows... –  jahroy Mar 14 '13 at 2:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.