Skip to content

Commit eb442c4

Browse files
authored
Add a workaround to make IRB work with debug's tests (#919)
1 parent 97898b6 commit eb442c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/irb.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,12 @@ def eval_input
10351035
@context.evaluate(statement.code, line_no)
10361036
when Statement::Command
10371037
ret = statement.command_class.execute(@context, statement.arg)
1038+
# TODO: Remove this output once we have a better way to handle it
1039+
# This is to notify `debug`'s test framework that the current input has been processed
1040+
# We also need to have a way to restart/stop threads around command execution
1041+
# when being used as `debug`'s console.
1042+
# https://github.com/ruby/debug/blob/master/lib/debug/irb_integration.rb#L8-L13
1043+
puts "INTERNAL_INFO: {}" if @context.with_debugger && ENV['RUBY_DEBUG_TEST_UI'] == 'terminal'
10381044
@context.set_last_value(ret)
10391045
end
10401046

0 commit comments

Comments
 (0)