script/console history

When you quit script/console you lose your command history. What
would it take to get get that command history to persist? I wouldn't
mind working on it if somebody had a good suggestion as to how to
achieve that and if it was an acceptable solution to the core team.

D :slight_smile:

Third Replicator,
If you are using some Linux system then you are safe. I use Ubuntu myself. I was tied of rewriting everything I put on the console too. So I with some little effort and help from friends, I made a small hack. Now, I have a simple script that helps me keep track of command-line history for both irb and script/console.

Follow the steps below:

  • create .irbrc file in your home directory :

ceekays@kanjedza:~$ touch .irbrc

  • open .irbrc using your preferred text editor (I prefer command-line based ones: vi, vim, gvim), add the following lines and * save*:
    *# This script saves and retrieves up to 600 lines of

command-line history in both irb and script/console

of a* *Rails’s project. (UP and DOWN ARROW keys to navigate)

In addition, it supports auto-completion.(Use the

TAB key to get auto-complete suggestions).*

.irbrc (929 Bytes)

Very nice! It works on my Mac 10.6, Ruby 1.9.1 via RVM, Rails 2.3.8.
I had to install a couple of the required gems. Do you have it on

D :slight_smile: