-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[BUG] pdb/breakpoint() isn't very usable during progress #1053
Comments
Setting My only issue with that is debugging changes what's being debugged. Might be fine if you are debugging some unrelated code, but if you are debugging anything related to the progress bar or what it renders, it's going to change things. I wonder what other TUI libraries do. |
Perhaps as a compromise, there should be a manual escape hatch? If I could blindly type |
That might be useful, bit I don't think it would help you much in the case of Live / progress. I think the reason you are not seeing input is that the thread to refresh the progress bars is still active. You could try |
Spam
…On Thu, 25 Feb 2021, 1:58 am Will McGugan, ***@***.***> wrote:
Setting breakpointhook is an interesting idea. It would have to wrap
whatever is already there so it doesn't break pdb.
My only issue with that is debugging changes what's being debugged. Might
be fine if you are debugging some unrelated code, but if you are debugging
anything related to the progress bar or what it renders, it's going to
change things.
I wonder what other TUI libraries do.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1053 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARR3REMBWMY7BFZDXQWVY3DTAU46BANCNFSM4YEVBQZA>
.
|
Closing because I can’t think of a good solution, but it’s something I’m thinking about. Going to be doing more work in the area. |
Alright - feel free to tag me if you need feedback or testing for something! |
I ran into this the other day as well, and was surprised by it as well. I worked around it by just removing the progress bars while debugging and then adding 'em back once I figured it out. I'd love to see a solution here as well (but agree that a good one seems elusive). |
@jacobian Only thing that occurs to me is to disable the refresh thread if the debugger is active. That's probably good enough, assuming you didn't want to debug the progress bars themselves. |
I ran into this as well. Is there an easy way to disable the refresh thread? |
I do not believe this issue can be marked as resolved. Currently, With a custom breakpoint hook, the user would expect the trace to be set at frame pdb.Pdb(sys._getframe().f_back).set_trace() It is a tough ask to expect each |
Could this be reopened? This is a complete dealbreaker if you use breakpoint() |
For my own purposes, setting |
I'm not too familiar with |
as far as I know every rich construct accepts a I'd guess that setting Either way, its essentially just forcing rich to act as it would inside a pipe or whatever where it wont output its fancy control codes. Which obviously isn't helpful if you're debugging rich output, but my own purposes were debugging my own code which just happened to be running in a context where rich was causing the described issues. And my guess would be most of the time/people in this thread are in the same boat. |
A solution that works for ninnies like me is using a pipe when debugging instead of fiddling with the
|
Describe the bug
When calling
breakpoint()
during progress, thepdb
prompt doesn't echo typed characters. Thus, it's not really possible to debug anything in the code running while progress is shown.I suppose rich could set sys.breakpointhook to first get the terminal out of raw mode when
breakpoint()
is used?(This is probably somewhere between bug report and feature request)
To Reproduce
Platform
Arch Linux, Kitty
Diagnose
See #1052.
The text was updated successfully, but these errors were encountered: