VS Code does not start from WSL due to collapted file

VS Code doesn’t start up from WSL… This problem occurred after showing a beautiful Windows blue screen!! It definitely broke something.

When executing code in WSL, the command doesn’t write anything to the console but VS Code doesn’t start.

When I started VS Code on Windows and tried to open a devcontainer, it didn’t proceed with the following message.

userEnvProbe is taking longer than 10 seconds. Avoid waiting for user input in your shell's startup scripts. Continuing.

VS Code showed the following error when I tried to open WSL folder on VS Code.

VS Code Server for WSL closed unexpectedly.
Check WSL terminal for more details.

I tried to uninstall WSL Extension on VS Code but it failed with the following error message.

VS Code Server for WSL closed unexpectedly.

Restarting WSL on Windows didn’t work either.

# Powershell or command prompt on Windows
wsl --shutdown
wsl
Sponsored links

How to Reinstall VS Code server

The necessary tools for VS code server are installed in ~/.vscode-server. Specifically, under ~/.vscode-server/bin/<random-value>. I guess some files there were broken due to the blue screen.

I removed the complete folder by the following command because no file exists under ~/.vscode-server/data/ and ~/.vscode-server/extensions/.

rm -rf ~/.vscode-server/

After this, executing code command in WSL downloaded the necessary tools again in ~/.vscode-server/bin/.
By the way, the random value for the folder was the same as before.

Comments

Copied title and URL