8

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?

2
  • Did you figure this out by any chance? :)
    – gak
    May 3, 2012 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, 2012 at 8:33

2 Answers 2

1

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.

1
  • If the mapping works in emacs mode, why not copy it across?
    – Tom Hale
    Aug 17, 2016 at 1:51
0

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.

1
  • I find j & k to be a LOT easier to type than the up/down arrows...
    – jahroy
    Mar 14, 2013 at 2:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .