debug
debug copied to clipboard
Debug freezes after a few keystrokes
Your environment
ruby -v: ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [arm64-darwin21]rdbg -v: rdbg 1.7.1
Describe the bug Debugger is freezing after typing a few keystrokes at random; almost reliably freezing with 3+ keystrokes. Any new key pressed just echoes in the screen the key pressed, but nothing happens.

It freezes the terminal window so bad that not even CTRL C can escape it:

To Reproduce
Just install a debugger anywhere in the code and start typing on the console.
Expected behavior I expected it not to freeze.
If I use binding.pry instead, everything works just fine.
Additional context Rails application (7.0.4.3)
Same reason here. Check this https://github.com/ruby/debug/issues/871#issuecomment-1366186813. It helped me too. Also take a note that for unknown reason setting value in ~/.rdbgrc does not work for me too https://github.com/nonsequitur/inf-ruby/issues/158#issuecomment-1016684874
Thanks for the tip @woto, exporting RUBY_DEBUG_NO_RELINE=1 in my .zshrc did the trick for me.
As discussed in the comment you linked, the problem seems to come from the reline gem. A patch has been merged recently but it has not yet been released
Thank you for survey. I want to wait the next release of reline.
I'm afraid this is not a reline issue but the same as #877. It's related to reline simply because it calls Timeout.timeout. That's why I original proposed RUBY_DEBUG_NO_RELINE=1 as a workaround in https://github.com/ruby/debug/issues/871#issuecomment-1364690830.
If we use a simpler repro I mentioned in this comment with the latest reline, it still freezes.
I think I was hit by this, and spent several weeks in agony due to "random" freezes. Now trying this "RUBY_DEBUG_NO_RELINE" workaround (and crossing fingers that it will resolve my problem with docker container).
Perhaps you should put this workaround as default option, and to get away from workaround behind env var instead (likely less time lost by random people around the world...)
Hi folks, could you try updating reline to 0.3.8 and let me know if that resolves the issue?
Awesome. Looks like it fixed!
sounds, marvellous [insert trumpet fanfare and confetti here], need to try it when possible