diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/irb.rb | 12 | ||||
-rw-r--r-- | lib/irb/ext/save-history.rb | 7 |
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/irb.rb b/lib/irb.rb index 755fb050ae..7f3de5dffe 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -117,6 +117,18 @@ STDOUT.sync = true # # require 'irb/completion' # +# === History +# +# By default, irb disables history and will not store any commands you used. +# +# If you want to enable history, add the following to your +.irbrc+: +# +# IRB.conf[:SAVE_HISTORY] = 1000 +# +# This will now store the last 1000 commands in <code>~/.irb_history</code>. +# +# See IRB::Context#save_history= for more information. +# # == Customizing the IRB Prompt # # In order to customize the prompt, you can change the following Hash: diff --git a/lib/irb/ext/save-history.rb b/lib/irb/ext/save-history.rb index d61fec9ff7..7b3fcbbeec 100644 --- a/lib/irb/ext/save-history.rb +++ b/lib/irb/ext/save-history.rb @@ -29,6 +29,13 @@ module IRB # Sets <code>IRB.conf[:SAVE_HISTORY]</code> to the given +val+ and calls # #init_save_history with this context. + # + # Will store the number of +val+ entries of history in the #history_file + # + # Add the following to your +.irbrc+ to change the number of history + # entries stored to 1000: + # + # IRB.conf[:SAVE_HISTORY] = 1000 def save_history=(val) IRB.conf[:SAVE_HISTORY] = val if val |