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

Hitting a breakpoint doesn't active window #105913

Closed
jrieken opened this issue Sep 2, 2020 · 10 comments
Closed

Hitting a breakpoint doesn't active window #105913

jrieken opened this issue Sep 2, 2020 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues insiders-released Patch has been released in VS Code Insiders regression Something that used to work is now broken verified Verification succeeded
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Sep 2, 2020

  • attach to extension host
  • use vscode-dev
  • hit a breakpoint
  • 🤷 be confused because VS Code doesn't "active" itself to let you know that you are paused on a breakpoint
@jrieken
Copy link
Member Author

jrieken commented Sep 2, 2020

related #100368

@isidorn isidorn added the debug Debug viewlet, configurations, breakpoints, adapter issues label Sep 2, 2020
@isidorn
Copy link
Contributor

isidorn commented Sep 2, 2020

This should just work, by calling hostService.focus here
Unless you have it disabled via

"debug.focusWindowOnBreak": false

I just tried it out and this works for me. What are you doing differently than me?
Here are my steps

  1. scripts/code.sh
  2. VS Code inisders, launch Attach to Extension Host config
  3. Put a breakpoint here in VS Code insiders and minimize the window. This is on the EH side.
  4. In scripts/code.sh start debugging
  5. Notice how the brekapoint gets hit and VS Code insiders gets revealed and focused

recording

@jrieken
Copy link
Member Author

jrieken commented Sep 2, 2020

I don't minimize, the window is simply in the background, goes into debug mode (status bar change) but doesn't activate:rec.40.mov.zip

@isidorn
Copy link
Contributor

isidorn commented Sep 2, 2020

Aha, yes now I get the same. That seems to be the issue with the hostService.focus on mac.
Let's aslo assign to @bpasero and @deepak1556 since this is controled by Electron
Gist from above: hostService.focus does not bring window to front. If window is minimized then it works fine.

@bpasero bpasero added this to the August 2020 milestone Sep 2, 2020
@bpasero bpasero added electron-9-update regression Something that used to work is now broken labels Sep 2, 2020
@bpasero
Copy link
Member

bpasero commented Sep 2, 2020

Say hello to #102997

@bpasero bpasero added the bug Issue identified by VS Code Team member as probable bug label Sep 2, 2020
@bpasero bpasero closed this as completed in 29ca95b Sep 2, 2020
@isidorn
Copy link
Contributor

isidorn commented Sep 2, 2020

Thanks Ben!

@connor4312 connor4312 added the verified Verification succeeded label Sep 3, 2020
@ArturoDent
Copy link

On W10 hitting a breakpoint doesn't switch focus back to vscode. It does the first time that breakpoint is hit, but never thereafter. Chrome debugger, vscode insider, W10.0.20206 - dev channel/fast ring.

breakpoint

Version: 1.49.0-insider (user setup)
Commit: e2f63c9
Date: 2020-09-03T17:27:16.893Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.20206

@isidorn
Copy link
Contributor

isidorn commented Sep 4, 2020

@bpasero can you double check this on Windows? I can also..

@bpasero
Copy link
Member

bpasero commented Sep 4, 2020

@isidorn at least from the Electron side of things this change should only impact macOS, no other platforms. And my change is also only having an effect on macOS, not Windows.

But it is possible that Windows has a similar protection that it does not allow a background app to come to the foreground, I suggest you try it out with VSCode stable vs insiders to check.

@isidorn
Copy link
Contributor

isidorn commented Sep 4, 2020

It works just fine both with Stable and with latest insiders.

@ArturoDent are you sure you do not have some special setting set, like for example "debug.focusWindowOnBreak": false

  1. VS Code insiders, clone smoketest express sample from here
  2. Open express repo in VS Code insiders, npm install from terminal
  3. Put a breakpoint in routes.ts line 6
  4. Open the browser, put VS Code insiders in breakpoint
  5. visit localhost:3000 - breakpoint nicely hit and the VS Code window gets nicely activated

I can repeate step 5 any number of times I want and VS Code window gets activated every time (it blinks in the windows status bar)

@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues insiders-released Patch has been released in VS Code Insiders regression Something that used to work is now broken verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants
@bpasero @deepak1556 @jrieken @isidorn @connor4312 @ArturoDent and others