Microsoft/vscode

Windows: unable to bring window to front even when trying to steal focus

Open

#251,849 opened on Jun 18, 2025

View on GitHub
 (3 comments) (1 reaction) (1 assignee)TypeScript (10,221 forks)batch import
bugconfirmedelectronhelp wantedupstreamworkbench-window

Repository metrics

Stars
 (74,848 stars)
PR merge metrics
 (Avg merge 11h 48m) (1,000 merged PRs in 30d)

Description

  • VS Code Version: 1.101.0
  • OS Version: Windows 11 Pro (26100.4349)

Steps to Reproduce:

  1. I am developing a vscode extension. The VSCode extension spawns a child process, and debugs said process. In windows I see that after I hit the breakpoint, the vscode can not become the current foreground windows, and only flashes on the windows status bar. (same repro as this old issue)

  2. I have verified the breakpoint in the below image hits in the F1 debugger, and routes down correctly into the electron API. Image

There are several solutions suggested on the electron issues board that could solve the problem for vscode. The final suggested solution, in short: minimize, show, setAlwaysOnTop, THEN focus.

Contributor guide