summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJames Reid-Smith <james.reidsmith@shopify.com>2024-12-12 12:26:03 -0500
committergit <svn-admin@ruby-lang.org>2024-12-12 17:26:06 +0000
commitc0caf1cc1aaa3ba2e9d09977ee2a51e35114c70f (patch)
tree3a654072aaec44c3766b58d48fa5d3b3632523a9 /lib
parent300be2b192a16c064d4e1c9203feda8df6a391fc (diff)
[ruby/irb] Load history when starting a direct debug session
(https://github.com/ruby/irb/pull/1046) * Load history when starting a direct debug session When starting a debug session directly with RUBY_DEBUG_IRB_CONSOLE=1 and `require 'debug'; debugger`, IRB's history wasn't loaded. This commit ensures history is loaded in this case by calling `load_history` when configuring IRB for the debugger. Fixes ruby/irb#975 * Update test/irb/test_history.rb * Update lib/irb/debug.rb --------- https://github.com/ruby/irb/commit/7f851b5353 Co-authored-by: Stan Lo <stan001212@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/debug.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/irb/debug.rb b/lib/irb/debug.rb
index cd64b77ad7..59be1365bd 100644
--- a/lib/irb/debug.rb
+++ b/lib/irb/debug.rb
@@ -81,6 +81,7 @@ module IRB
IRB.instance_variable_set(:@debugger_irb, irb)
irb.context.with_debugger = true
irb.context.irb_name += ":rdbg"
+ irb.context.io.load_history if irb.context.io.class < HistorySavingAbility
end
module SkipPathHelperForIRB