Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable pry-byebug when invoked by pry-rescue #422

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

afn
Copy link

@afn afn commented Sep 22, 2023

See ConradIrwin/pry-rescue#124 --- pry-byebug doesn't play nicely with pry-rescue. pry-rescue works by capturing the call stack, and later invoking pry using that call stack (not the current one) as the target.

I think the correct fix would be to allow ByeBug::PryProcessor.start (called from here) to receive a target and use that to initialize the context of byebug. But there doesn't seem to be an easy way to modify byebug to operate within an arbitrary call stack.

So as a workaround for now, just disable the use of byebug when pry was entered via pry-rescue. We can detect this by the presence of the save_captured_exception hook.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant