?

Log in

Getting irb history without readline - Testing 1,2,3... [entries|archive|friends|userinfo]
djberg96

[ website | Netrunner Tracker ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Links
[Links:| Ruby Home RubyForge RAA comp.lang.ruby Ruby Documentation ]

Getting irb history without readline [May. 17th, 2014|01:46 am]
djberg96
[Tags|, ]

I built Ruby 2.1.2 from source and got all the desired 3rd party libs installed except readline. A minor nuisance since it mostly only affects irb and history. Except I want irb history so I can use the up arrow key to recall commands.

I tried rb-readline but it was acting weird, with stray characters appearing and general wonkiness that I can't describe. Instead, I installed rawline and modified the irb/completion.rb file so that it requires rawline instead of readline.

Works like a champ.

Update: Also, put "require 'irb/completion'" in your .irbrc file and make sure your HOME env is set. You may need to replace instances of Readline with Rawline in irb/completion.rb.
linkReply