jameshfisher
jameshfisher

Reputation: 36397

Ruby Irb reacts strangely to control keys

I'm (extremely) new to Ruby, having started today.

I just moved from my system's Ruby 1.8 installation to Ruby 1.9, compiled from source. In doing so, irb has taken a turn for the worse. It reacts in a most unfriendly way to the non-alphanumeric control keys:

UP key prints: ^[[A

DOWN key prints: ^[[B

DELETE key prints: ^[[3~

...and so on. The main result of this for me is that I have no access to previously issued commands. Nor does tab-completion work; though none of this seems to be an issue with Wirble - the same happens when I remove my ~/.irbrc.

I'm using:

Any ideas? :(

Upvotes: 1

Views: 819

Answers (3)

rubiii
rubiii

Reputation: 6983

readline is the correct answer. just wanted to say that for os x, you can install readline via homebrew.

Upvotes: 0

gabrielf
gabrielf

Reputation: 2269

If you use OS X Snow Leopard and have the same problem there is a description how to fix it here: http://snippets.dzone.com/posts/show/10511

Upvotes: 1

Oleg Shaldybin
Oleg Shaldybin

Reputation: 1025

This could be a readline issue. You could try installing libreadline and libreadline-dev packages and rebuild Ruby after that, see if it helps:

apt-get install libreadline5 libreadline5-dev

Upvotes: 5

Related Questions