简体   繁体   中英

"code ." no longer working in WSL2 when attempting to open VSCode

I type in the expected code. and get the following message:

在此处输入图像描述

Ive tried different "solutions" from other SO posts, but nothing has proven effective. This has just started happening today (8/8/22), and I didn't make any changes that I can recall. Any tips would be greatly appreciated on how to resolve this.

I had the same issue, and I finally got it working by reinstalling VS Code locally. Code was missing from my %PATH% environment variable, and I found the code command wasn't working locally either. I was able to fix this by reinstalling VS Code. I could probably have just added the installation directory to the %PATH% as well, but wanted to make sure everything was properly repaired with a fresh install.

The WSL init process appends the Windows %PATH% to the Linux $PATH by default, so terminating and restarting my WSL distro fixed the issue on WSL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM