vscode: VSCode hangs when switching between local login and remote desktop login

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.73.1
  • OS Version: Windows_NT x64 10.0.22621

Steps to Reproduce:

  1. Log in locally to your Windows desktop
  2. Set scaling to 150% (Control Panel–>System–>Display)
  3. Take note of the display resolution
  4. From a local login, open a project in VSCode
  5. Lock the local workstation (do not log out)
  6. From a different system where scaling is set to something other than 150%, and preferably the resolution is also different
  7. Open Remote Desktop Connection
  8. Enter the IP of the original system
  9. Click Connect
  10. Log in

VSCode will resize the outermost frame of the window, but will leave Explorer and code windows smaller, and will be unresponsive to mouse or keyboard input. After about 15 seconds, you’ll get a popup that says:

“The window is not responding. You can reopen or close the window or keep waiting”

If you choose “Reopen”, a new instance of VSCode will launch and will work fine. If you Keep Waiting, it will never come back.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 36
  • Comments: 51 (2 by maintainers)

Most upvoted comments

My solution

  1. add a keyboard layout (Add a keyboard: https://support.microsoft.com/en-us/windows/manage-the-input-and-display-language-settings-in-windows-12a10cb4-8626-9b77-0ccb-5013e0c7c7a2#WindowsVersion=Windows_11)
  2. change keyboard layout (Win + Space bar) keyboard
  3. get back keyboard layout (Win + Space bar)

Problem solving!

I found an extremely ugly but effective temporary solution to recover from an unresponsive window input without needing to restart VSCode.

When the window becomes unresponsive, losing and regaining focus can restore operation, but if you enter any character again, the window will freeze.

In a fortuitous circumstance, I found that you can continuously input any characters(Press a character button without releasing it) when the window freezes, then click any other character-inputable area within the frozen window (while still inputting characters), then make the window to lose focus and regain it. This will restore the window from freezing.

You might not have enough hands to make the window lose focus, but remember, the Windows key (Win key) can also do the trick.

This should fix (at least partially) once VSCode upgrade to a electron version that based on Chromium 124.0.6367.0 https://chromium-review.googlesource.com/c/chromium/src/+/5365680

I found an extremely ugly but effective temporary solution to recover from an unresponsive window input without needing to restart VSCode.

When the window becomes unresponsive, losing and regaining focus can restore operation, but if you enter any character again, the window will freeze.

In a fortuitous circumstance, I found that you can continuously input any characters(Press a character button without releasing it) when the window freezes, then click any other character-inputable area within the frozen window (while still inputting characters), then make the window to lose focus and regain it. This will restore the window from freezing.

You might not have enough hands to make the window lose focus, but remember, the Windows key (Win key) can also do the trick.

I found an extremely ugly but effective temporary solution to recover from an unresponsive window input without needing to restart VSCode.

When the window becomes unresponsive, losing and regaining focus can restore operation, but if you enter any character again, the window will freeze.

In a fortuitous circumstance, I found that you can continuously input any characters(Press a character button without releasing it) when the window freezes, then click any other character-inputable area within the frozen window (while still inputting characters), then make the window to lose focus and regain it. This will restore the window from freezing.

You might not have enough hands to make the window lose focus, but remember, the Windows key (Win key) can also do the trick.

it works! My operation process: 1: When vscode freezes and does not respond, open any other software (such as chrome or edge); 2: Switch back to vscode, press and hold any key on the keyboard without releasing it, and use the mouse to click on the frozen vscode window at the same time; 3: After clicking, switch to other open software, and switch back again to exit the frozen state.

Now, the EDGE has the same problem!

I’ve seen this with Google Chrome too. VS Code, and Windows Terminal.

For Windows Terminal I’ve tried their Preview and it uses different rending logic apparently. Team indicate some issues with NVIDIA – but that has done better in haven’t seen freezes.

Edge surprisingly “recovers” after a bit; where as Google Chrome never does.

VS Code I’ve affected the experimental terminal GPU rendering flag to “canvas” for now to see if that helps.

This seems like a Windows/NVIDIA driver issue on desktop resizing.

So, kinda seems Chromium based.

I think this has something to do with Chromium, because I also have this problem when using the remote Edge browser.

same issue.

Not specific to VS Code and not specific to Local/Remote changing. I’m working remotely for vacation and haven’t been local. It happens on first connect and also when I lose internet (spotty WiFi) and reconnect. I have 3 Chromium-based windows opened: VSCode, Chrome with default profile and Chrome with a non-default profile (debugging window). Just connecting over RDP will hang VS Code and my primary Chrome window. Oddly enough a Chrome window not on default profile (the one I had open for debugging) responds just fine.

Opening a new tab in Chrome via the Windows taskbar will show a white window. But eventually, after a long while everything will start working again.

Happens with Chrome Canary as well. It’s a rendering issue, seems like, which is interesting because the mouse cursor does change and I can close a Chrome window if I click on the x on the only opened tab.

Nvidia GPU and Windows 11 (though graphics card is probably irrelevant since it’s running on the Microsoft Remote Display Adapter driver).

I started a Chromium Issue, vote and comment if you are interested:

https://bugs.chromium.org/p/chromium/issues/detail?id=1514402

I’m not sure if it duplicates, but the bug exists for years so I guess not. 😂

windows 11, version 23h2 update

My solution

1. add a keyboard layout (Add a keyboard: https://support.microsoft.com/en-us/windows/manage-the-input-and-display-language-settings-in-windows-12a10cb4-8626-9b77-0ccb-5013e0c7c7a2#WindowsVersion=Windows_11)

2. change keyboard layout (Win + Space bar)

3. get back keyboard layout (Win + Space bar)

Problem solving!

It seems to not work after windows 11, version 23h2 update.

in windows 11, version 23h2 update. (korean) https://sanctacrux.tistory.com/1930

summary

  1. 설정
  2. 시간 및 언어
  3. 언어 및 지역
  4. 한국어 / 언어옵션
  5. Microsoft 입력기 /  키보드옵션
  6. 호환성 / 이전 버전의 Micorosoft IME 켬

google tranlation

  1. Settings
  2. Time and language
  3. Language and region
  4. Korean / language option (your input language)
  5. Microsoft input method / keyboard options
  6. Compatibility / Turn on older versions of Microsoft IME

couldn’t find any official microsoft documentation.

My solution

1. add a keyboard layout (Add a keyboard: https://support.microsoft.com/en-us/windows/manage-the-input-and-display-language-settings-in-windows-12a10cb4-8626-9b77-0ccb-5013e0c7c7a2#WindowsVersion=Windows_11)

2. change keyboard layout (Win + Space bar)

3. get back keyboard layout (Win + Space bar)

Problem solving!

It seems to not work after windows 11, version 23h2 update.

Some hint: Prevent using Microsoft’s IME ( like Microsoft Pinyin/Wubi , Japanese …). Using third-party IME instead helps on this issue.

Yes, I have seen this issue for more than one year when remote desktop to my office PC running VSC or Edge browser.

I had to restart VSC or Edge when I hit this nasty issue every time.

Windows 11 22H2 (22621.2248) VSC: 1.84.2

My solution

  1. add a keyboard layout (Add a keyboard: https://support.microsoft.com/en-us/windows/manage-the-input-and-display-language-settings-in-windows-12a10cb4-8626-9b77-0ccb-5013e0c7c7a2#WindowsVersion=Windows_11)
  2. change keyboard layout (Win + Space bar) keyboard
  3. get back keyboard layout (Win + Space bar)

Problem solving!

Wow thanks, your workaround is a life saver, it works not only for VSCode but also for the frozen Edge, Teams, Chrome, etc…

same issue

same issue. has long time.

VS Code Version: 1.81.1 Windows Version: Windows 11 Pro for Workstations, 22H2, Build 22621.2134

@yo1dog That seems to point to an issue with electron or browserview then.

For context, this is not unique to vscode for me. The Slack desktop app (pretty sure is also web/browser based) exhibits similar behavior.

same problem for a long time