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

irb as _default_ debug front-end? #712

Closed
jon-sully opened this issue Sep 16, 2023 · 6 comments · Fixed by ruby/debug#1024
Closed

irb as _default_ debug front-end? #712

jon-sully opened this issue Sep 16, 2023 · 6 comments · Fixed by ruby/debug#1024
Labels
enhancement New feature or request

Comments

@jon-sully
Copy link

Description

Greetings! I've been playing with the new irb/debug integration that was recently released and overall the experience is really great. Having full irb context while being in a full debug session is really nice. The irb:rdbg prompt is easy to work with and simple — kudos! ☺️

I'm hoping we can improve the experience a bit though. My understanding is that right now the only way to properly enter this context/experience is to use binding.irb to halt the code, then once in that irb session, manually call debug.

After migrating to the debug gem after years of pry/byebug, it took some time for me to retrain my muscle memory for debugging to use debugger rather than binding.pry etc. but I've found that even with irb's new front-end integration working with the debug gem, the debugger still only loads the default debug front end. Is there any way that we could consolidate the whole experience such that simply using debugger drops into the full irb:rdbg session?

@st0012
Copy link
Member

st0012 commented Oct 2, 2023

After chatting with the maintainer of debug, he agreed to make this interface part of the debug gem. The details are:

  • Its current REPL will still be preserved and be the default. But users can use irb:rdbg as the default REPL by setting a configuration (e.g. RUBY_DEBUG_IRB_CONSOLE=1)
  • When users use the irb command, it should open the irb:rdbg console instead of vanilla IRB
  • Remote debugging will not be supported at the beginning

@jon-sully
Copy link
Author

  • But users can use irb:rdbg as the default REPL by setting a configuration (e.g. RUBY_DEBUG_IRB_CONSOLE=1)

Sweet!

Remote debugging will not be supported at the beginning

Fair 'nuff!

Any idea what the best way to follow this development is? Ready to upgrade my debug gem whenever that ships!

@st0012
Copy link
Member

st0012 commented Oct 10, 2023

I've opened ruby/debug#1024 upstream to make its irb command opening up an irb:rdbg session. It could still take a while to polish before merging though.

@jon-sully
Copy link
Author

Understandable! Thank you for this 🙏 I've been spending more time lately kicking into irb from a debug session now that I know how, and I vastly prefer it to the pure rdbg prompt

@jon-sully
Copy link
Author

Woop woop! Out of curiosity, did ruby/debug#1024 include this functionality?

Its current REPL will still be preserved and be the default. But users can use irb:rdbg as the default REPL by setting a configuration (e.g. RUBY_DEBUG_IRB_CONSOLE=1)

@st0012
Copy link
Member

st0012 commented Dec 5, 2023

@jon-sully Yes it does 😄

@st0012 st0012 added the enhancement New feature or request label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

2 participants