irb's readline history

A

Albert Schlef

irb is nice, because is uses readline. I can press <key-up> to bring to
life previously typed lines. That's good. But if I exist irb and then
return to it the history is gone. So it's not like bash(1) and mysql(1)
that save the history is a file. Or is it? Is it possible to make irb
save the history in a file so that I don't have to retype everything if
I restart it?
 
A

Avdi Grimm

irb is nice, because is uses readline. I can press <key-up> to bring to
life previously typed lines. That's good. But if I exist irb and then
return to it the history is gone. So it's not like bash(1) and mysql(1)
that save the history is a file. Or is it? Is it possible to make irb
save the history in a file so that I don't have to retype everything if
I restart it?

Yes.

Utility Belt (http://utilitybelt.rubyforge.org/) enables this and many
other tweaks.

--
Avdi

Home: http://avdi.org
Developer Blog: http://avdi.org/devblog/
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com
 
J

Joel VanderWerf

Albert said:
irb is nice, because is uses readline. I can press <key-up> to bring to
life previously typed lines. That's good. But if I exist irb and then
return to it the history is gone. So it's not like bash(1) and mysql(1)
that save the history is a file. Or is it? Is it possible to make irb
save the history in a file so that I don't have to retype everything if
I restart it?

Put this in your .irbrc:

IRB.conf[:SAVE_HISTORY] = 100
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top