-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
When thread is no longer stopped the focus is not automatically passed to another thread #125144
Comments
Thanks for opening the issue and I agree we should improve here. As I mentioned the problem on the VS Code side is the following:
I am open for ideas on how to solve this. But we might need to add some hints to the DAP so the debug adapter could control this. Let me know what you think. Thanks |
@isidorn The way Visual Studio handles this situation is that if the UI gets multiple stopping events, the subsequent stopping events are queued. Hitting F5 just dequeues the next stopping event, so we will switch focus to that process. I don't see any reason why this approach wouldn't work for VS Code as well. This wouldn't require any DAP changes. |
@isidorn Gregg's suggestion sounds like an excellent idea. |
We can try that out. But the problem is that if Thread T1 we hit continue we will automatically switch focus to an already stopeed thread T2, even if T1 is about to stop in 100ms. We can treat |
@isidorn No, full VS has the same behavior for all three execution commands. This can cause annoying bouncing back and forth if the process you aren't trying to step is hitting breakpoints. Fortunately if this happens you can, as a user of the debugger, fix this by disabling your breakpoints and hitting continue. Then when you step completes things will stay on the stepping process. We have thought about implementing a "priority boost" where if the user hits step will will wait a small amount of time before dequeuing breakpoint events from other threads/processes. But the priority of this scenario has never risen high enough to implement something like this. The tricky part is to find the right delay period. You don't want to wait too long since the stepping thread may be waiting on the other process/thread (the one that is stopped). On the other hand, too short of a delay means we are back to alternating threads. |
@gregg-miskelly thanks for providing more details. Making the user disable all breakpoint before stepping sounds like a bad experience. Maybe a simple 500ms delay would help. Since most of the steps would hit a consequent stop in that time. |
I have looked into this and here are my findings:
Due to point 3 and to the problem of back and forth between two threads I have decided to only auto focus thread / session after @luabud @gregg-miskelly @testforstephen please try it out from tomorrow and let me know what you think. In the testing that I have done this is the approach I liked the best, however I am open for suggestions on how to improve. |
hm, this doesn't seem to work for me using the original example: https://memes.peet.io/img/21-06-bae6a450-922b-4f9c-9c30-8d64fdc6898b.mp4 |
@connor4312 good catch, I missed a case here. Also I decided to not overcomplicate to start: there will be no |
I know it's been verified but just wanted to leave a late note saying the experience looks great for Python 😊 thanks a lot!! |
Hey there!
We have a problem in the Python extension when it comes to the UX of multi-process debugging.
Take the example below:
If you add a breakpoint to e.g. line 7 (res = x ** 3), start debugging this file in VS Code (just make sure to select "Python File" from the drop down menu once you hit F5) and hit continue, the first subprocess that is in focus will continue, and the focus will remain in it, even though you have multiple other subprocesses paused on that breakpoint.
The request here is if there's a way the focus could automatically switch to another subprocess that is paused.
The text was updated successfully, but these errors were encountered: