microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.57k stars 29.02k forks source link

VSCode hangs when switching between local login and remote desktop login #167556

Open shaunco opened 1 year ago

shaunco commented 1 year ago

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

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.

ringwraith commented 1 year ago

same problem for a long time

vware commented 1 year ago

same here, but not for a long time. started to happen after most recent win11 upgrade. chrome actually had the same problem, but that one is fixed now. vscode isnt, sadly.

jozocai commented 1 year ago

Similar here

XianwuLin commented 1 year ago

same issue.

liberize commented 1 year ago

very annoying

yo1dog commented 1 year ago

If you Keep Waiting, it will never come back.

In my case, if you wait 1-2 minutes it eventually comes back.

zerkz commented 1 year ago

weird. started the profiler through the developer tools, disconnected RDP, reconnected, waited couple mins for vscode to unfreeze, and stopped the profiler.

Nothing stood out to me as "stuck" or taking a long time from the gpu or main.js thread.

yo1dog commented 1 year ago

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

zerkz commented 1 year ago

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

cicorias commented 1 year ago

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.

zerkz commented 1 year ago

I have a AMD card so that throws the nvidia issue out -- but could still be chromium/windows related 🤔

cpbotha commented 1 year ago

I am seeing similar behaviour as @cicorias

Windows Terminal will freeze completely. Their main issue for this is https://github.com/microsoft/terminal/issues/12607 -- I have disabled hardware rendering for Terminal, and it seems to help.

My VSCode is also frozen when I re-attach, either via RDP, or at the machine in question, but indeed it ofter recovers after a few minutes, sometimes asking to reconnect. (I use WSL) For now I have added "disable-hardware-acceleration": true to Preferences: Runtime arguments

So far, my Edge has not yet been able to recover, but I have never been able to wait long enough.

I have an nvidia in this machine.

clshortfuse commented 1 year ago

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).

elephaint commented 1 year ago

Same issue here (both in VS code and e.g. Edge), but disabling gpu when starting VS Code seems to have fixed the problem for me, i.e. start vs code by running:

code --disable-gpu

For now I'm ok with this fix, but I might fiddle around with different GPU drivers in the future to see if it that's the issue.

My setup:

The issue occured under the following circumstances:

Crear12 commented 1 year ago

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.

Oh, I encountered frozen Windows Terminal frequently. Then I have to use Admin to run Anaconda Prompt because I have some intensive tasks that need to run multiple days. I never thought it's caused by Remote Desktop...

For VS Code..Seriously? Almost the best tool I've ever used, but also, I'm more of a RDP guy. C'mon, both RDP and VS Code are from Microsoft......

rwasef1830 commented 1 year ago

KB5022913 for Windows 11 22H2 appears to solve this issue for Edge/Chrome/Windows Terminal. It may solve it for VS Code as well.

LancelotLewis commented 1 year ago

KB5022913 for Windows 11 22H2 appears to solve this issue for Edge/Chrome/Windows Terminal. It may solve it for VS Code as well.

seems not work well

kishoredbn commented 1 year ago

I am still seeing this problem. I am in most updated Windows 11.

Here is a screenshot https://pasteboard.co/QyG6ZKRdQqqZ.png

whyb commented 1 year ago

Same issue. Recently, The edge browser has the same problem, which seems to be a problem of upstream chromium.

xgfone commented 1 year ago

I met with the same trouble. Just for VSCode on Windows 11, and other softwares, such as Edge, are OK. VSCode on Linux is OK.

Any update on this?

loming1st commented 1 year ago

Seems to be fixed in the KB5026372 update.

xgfone commented 1 year ago

Seems to be fixed in the KB5026372 update.

I have installed the KB5026372 update, but the issue still exists. image

fakerror commented 1 year ago

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.

devjeonghwan commented 1 year ago

Same problem for a year...

Student414 commented 1 year ago

same issue.

wpc2333 commented 1 year ago

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.

yo1dog commented 1 year ago

This was fixed for me a long time, but I forgot about this ticket and when exactly it was fixed. Don't know if it was a vscode update or Windows update that fixed it, but I am currently on:

Version: 1.80.2 (user setup)
Commit: 2ccd690cbff1569e4a83d7c43d45101f817401dc
Date: 2023-07-27T20:40:28.909Z
Electron: 22.3.14
ElectronBuildId: 22695494
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22621

Windows OS Build: 22621.2134

xgfone commented 1 year ago

The trouble still exists for me.

Version: 1.81.1 (user setup)
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:22:42.175Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22621

Windows OS Build: 22621.2134

iruis commented 1 year ago

same issue. has long time.

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

hdformat commented 1 year ago

same issue. i always restart vscode, slack and the other apps based electron when i face this

DUWENINK commented 1 year ago

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

ZiJiaW commented 1 year ago

same issue

iruis commented 1 year ago

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!

Senorsen commented 1 year ago

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...

timhub commented 1 year ago

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!

This works for me, it's not the first time that Microsoft keyboard yields a major issue.

hezzze commented 11 months ago

same issue here

版本: 1.83.1 (user setup) 提交: f1b07bd25dfad64b0167beb15359ae573aecd2cc 日期: 2023-10-10T23:48:05.904Z Electron: 25.8.4 ElectronBuildId: 24154031 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.22621

My issue more specifically is whenever I login again after a remote session, the terminal stop working as every time I try to type something it stuck

reitowo commented 11 months ago

It's been a year, is anyone reporting this to chromium upstream? Anyway to track the upstream fix?

saltfishmx commented 11 months ago

same issue

lbmeng commented 10 months ago

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

march1993 commented 10 months ago

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 tried to kill ChsIME.exe and then the problem got solved too.

DUWENINK commented 9 months ago

this issue make me unhappy a lot,i can not solve by my self ,if have some solution about this, call back me ,thankyou

reitowo commented 9 months ago

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. 😂

k773920063 commented 9 months ago

Now, the EDGE has the same problem!

DUWENINK commented 8 months ago

Maybe this just happened in the China Language Env?

jackyzy823 commented 8 months ago

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

iruis commented 8 months ago

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.

reitowo commented 7 months ago

The simplest solution is:

  1. Press Windows key
  2. After Windows Menu pops up, switch to another keyboard layout (Alt + Shift, and English layout in my case)
  3. Go back to your app window
  4. Switch back to previous layout, and continue your work
iruis commented 7 months ago

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.

yindaheng98 commented 7 months ago

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.

it works! thank you so much!

reitowo commented 7 months ago

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