March 25th, 2007

IRB History

Add the following to your ~/.irbrc to get history through multiple IRB sessions:

1
2
3
4
5
6

require 'irb/completion'
require 'irb/ext/save-history'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"

For more IRB Tips and Tricks be sure to check out the Ruby Garden Wiki


Comments

Matt A says:

March 26, 2007 @ 08:57 AM

That is just awesome. Last week, I was complaining about the lack of history through multiple IRB sessions. Thanks a lot.