Skip to content

Commit

Permalink
Don't enable the tracer when stopped by pry-rescue
Browse files Browse the repository at this point in the history
See ConradIrwin/pry-rescue#124 --- pry-byebug
doesn't play nicely with pry-rescue. Detect if we're in a rescued
exception, and if so, use pry without byebug.
  • Loading branch information
afn committed Sep 21, 2023
1 parent 4eb7421 commit 6adc589
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pry-byebug/pry_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class << Pry::REPL
def start_with_pry_byebug(options = {})
target = options[:target]

if target.is_a?(Binding) && PryByebug.file_context?(target)
if target.is_a?(Binding) && PryByebug.file_context?(target) && !options[:hooks]&.hook_exists?(:before_session, :save_captured_exception)
Byebug::PryProcessor.start unless ENV["DISABLE_PRY"]
else
# No need for the tracer unless we have a file context to step through
Expand Down

0 comments on commit 6adc589

Please sign in to comment.