diff --git a/lib/irb/statement.rb b/lib/irb/statement.rb index 9493c3ffb..0a9007813 100644 --- a/lib/irb/statement.rb +++ b/lib/irb/statement.rb @@ -60,7 +60,8 @@ def suppresses_echo? end def should_be_handled_by_debugger? - IRB::ExtendCommand::DebugCommand > @command_class + require_relative 'cmd/help' + IRB::ExtendCommand::DebugCommand > @command_class || IRB::ExtendCommand::Help == @command_class end def evaluable_code diff --git a/test/irb/test_debug_cmd.rb b/test/irb/test_debug_cmd.rb index a99f7a943..1bc7cb51c 100644 --- a/test/irb/test_debug_cmd.rb +++ b/test/irb/test_debug_cmd.rb @@ -331,6 +331,20 @@ def bar assert_include(output, "InputMethod: RelineInputMethod") end + def test_help_command_is_delegated_to_the_debugger + write_ruby <<~'ruby' + binding.irb + ruby + + output = run_ruby_file do + type "debug" + type "help" + type "continue" + end + + assert_include(output, "### Frame control") + end + def test_input_is_evaluated_in_the_context_of_the_current_thread write_ruby <<~'ruby' current_thread = Thread.current