Vscode: Windows 10: focus is not put to window but taskbar blinks

Created on 2 Dec 2015  路  11Comments  路  Source: microsoft/vscode

This can happen when code is already running and you start it again from the command line: The process that is started is killed very early after sending a IPC message to the running instance and that running instance is then trying to restore/focus the last active window which often fails.

Related: https://github.com/atom/electron/issues/2867

As a workaround if you have access to the windows registry:

  • regedit.exe
  • find ForegroundLockTimeout
  • change its value to 10 (decimal)
  • restart windows
bug help wanted verification-needed verified

Most helpful comment

I've been hit with this bug suddenly after having code working_dir filename style execution from WinSCP work flawlessly for months. On top of that, the suggested workaround doesn't work as ForegroundLockTimeout is nowhere to be found in my registry.

Reading this it looks like the issue was fixed but has there been a regression?

All 11 comments

Pushed a workaround.

Reopening, using the window.show() workaround causes issues as it will undock windows it seems.

This happens EVERY time for me - on all 3 machines I use it on, Windows 7 and Windows 10.

As a workaround if you have access to the windows registry:

  • regedit.exe
  • find ForegroundLockTimeout
  • change its value to 10 (decimal)
  • restart windows

@bpasero Just tried the suggested workaround and it did not work.

Using Windows 10 Home

I've been hit with this bug suddenly after having code working_dir filename style execution from WinSCP work flawlessly for months. On top of that, the suggested workaround doesn't work as ForegroundLockTimeout is nowhere to be found in my registry.

Reading this it looks like the issue was fixed but has there been a regression?

Seems to have re-emerged for me. On first launch of VSCode it will focus on top of other windows, but on subsequent launches it stays in the background and flashes in the taskbar. I searched the registry but can't find any reference to ForegroundLockTimeout.

I'm on Win10 Build 10240

On top of that, the suggested workaround doesn't work as ForegroundLockTimeout is nowhere to be found in my registry.

Must have made the rookie mistake of not starting the search in the registry root earlier. It turns out there are several hits and the first one in \HKEY_CURRENT_USER\Control Panel\Desktop seems to have worked.

I started running into this issue today. Started when I would open a new window from my current window and the new window would not appear on screen, only in the taskbar. Upon restarting the PC, no windows now appear. Tried the workaround but with no luck. Windows10 Build 15063

Update: I made it to work by right clicking the task bar editor thumbnail of VSC and clicking on move. This made my cursor move to the edge of the desktop. I then dragged the corner of the VSC window to bring it to the center. It looks like VSC window was off the desktop boundary for some reason

I have made registry changes to hkey_local_machine and hkey_current_user as mentioned but it still doesn't work. Any other suggestions? Reinstalling doesn't fix the issue either.

This is happening to me also since the previous 2 releases. Changing the value of ForegroundLockTimeout did not help

Was this page helpful?
0 / 5 - 0 ratings