vscode: Breakpoint hit -> window gets focused -> VS Code freezes for some time
- VS Code Version: 1.56.0
- OS Version: Windows_NT x64 10.0.18363
Steps to Reproduce:
- Set breakpoint in js.-file
- Launch debug-session in browser (all breakpoints in dev-mode disabled)
- Switch to browser window
- Maximize browser (because it is just half open)
- Hit breakpoint
- VSCode blinks in taskbar -> switch back to it
- VSCode freezes and waits for something
Hints:
- By avoiding step 4, this issue doesn’t occur.
- Minimizing and maximizing VSCode while its freezed solves this issue.
- This issue also happens in insider-version of VSCode.
Does this issue occur when all extensions are disabled?: Yes
Launch configuration (no, this problem is not related to brave, it happens also in google chrome):
{
"name": "Browser debug",
"request": "launch",
"type": "pwa-chrome",
"runtimeExecutable": "C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe",
"runtimeArgs": ["--remote-debugging-port=9222"],
"url": "http://127.0.0.1:5000",
"webRoot": "${workspaceFolder}\\memory-viewer\\server",
"pathMapping": {
"/css": "${workspaceFolder}\\memory-viewer\\server\\static\\css",
"/app": "${workspaceFolder}\\memory-viewer\\server\\static\\app",
"/js": "${workspaceFolder}\\memory-viewer\\server\\static\\js"
}
},
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 22
- Comments: 42 (11 by maintainers)
This issue has been open for over a year now. Has there been any progress on fixing this bug? Is there an ETA? Has the root cause for the
CalculateNativeWinOcclusion
bug even been identified yet? I’d prefer not to add a launch flag, because I’m likely to forget to remove it once it eventually gets fixed.This issue still happens for me on Windows 11 with all the latest updates. It also happens when I simply leave the computer unattended for a while. VSCode hangs and takes ~30s to respond to input again. Same thing happens with certain pages opened in Chrome.
Still have this on Windows 10 and latest VSCode version. Annoying 😦
Solution here: https://github.com/microsoft/vscode/issues/146737#issuecomment-1153128058
I have the same issue with VS Code 1.60.1 and Windows 10 build 19043.
A working workaround is setting
"debug.focusWindowOnBreak": false
, as @isidorn mentioned.I also saw that if I grab the VS Code window by the title bar and then maximize it by dragging it to the top of the screen, it unfreezes instantly.
Please fix this, it’s so annoying. Thank you.
There is a workaround on disabling this option in VS Code Settings. By doing this u have to live with the fact that the VS Code icon will not blink in the taskbar when the debugger hits a breakpoint But the Window will also not freeze
I am still having this issue too, on Windows 10 with the code running inside WSL2. I’m using the
"debug.focusWindowOnBreak": false
workaround, which is not perfect but ok.If it can help, I noted that without
"debug.focusWindowOnBreak": false
, if you click on any open editor and then click on the editor containing the target breakpoint, then the breakpoint hits almost immediately… But that sucks because you need to know what editor to click, it doesn’t show up automatically. Using theCall Stack
is another trick to know where the hitted breakpoint is. But those are all workarounds looking for a real solution.The latest version of Chrome browser has a similar phenomenon. I think this is Chromium’s problem.
Yes, there is no freeze. The icon in the taskbar is also not blinking.
With
I can reproduce the issue.
With
(as the command says) VSCode window does not focus, but breakpoint got hit successfully.
@MaxHausmann lovely thanks a lot. This happens only on Windows, thus assigning
windows
flag, and it seems to be electron related thus assigning to my friend @deepak1556We will investigate if we can fix this as part of the recovery release. If not we plan to fix it in the future
I can confirm that this behavior still exists. It’s very annoying because, at least me, need to check if I did something wrong while debugging and then switch multiple windows to finally have the visible breakpoint in VS Code.
This will be fixed in the May release, the issue is open to eliminate the workaround we have set.
@MaxHausmann can you reproduce if you start vscode with
code --disable-features=CalculateNativeWinOcclusion <path to workspace/folder>
This looks like a regression of the issue mentioned in #116865, #117780, and others and declared a duplicate of #114459. It was fixed in 1.55 but it’s back. Super annoying.