Skip to content

Commit

Permalink
Add a workaround to make IRB work with debug's tests
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Apr 10, 2024
1 parent 97898b6 commit f714a5a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/irb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,12 @@ def eval_input
@context.evaluate(statement.code, line_no)
when Statement::Command
ret = statement.command_class.execute(@context, statement.arg)
# TODO: Remove this output once we have a better way to handle it
# This is to notify `debug`'s test framework that the current input has been processed
# We also need to have a way to restart/stop threads around command execution
# when being used as `debug`'s console.
# https://github.com/ruby/debug/blob/master/lib/debug/irb_integration.rb#L8-L13
puts "INTERNAL_INFO: {}" if @context.with_debugger && ENV['RUBY_DEBUG_TEST_UI'] == 'terminal'
@context.set_last_value(ret)
end

Expand Down

0 comments on commit f714a5a

Please sign in to comment.