开发者

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 comma开发者_运维百科nds. 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:

  • Ubuntu 9.10
  • GNOME Terminal 2.28.1
  • ruby 1.9.1p376 (2009-12-07 revision 26041) [i686-linux]
  • Irb version 0.9.5 (05/04/13)

Any ideas? :(


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


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜