wsl 系统中编辑文件,用 vscode 则提示一下内容:

To use VS Code with the Windows Subsystem for Linux, please install VS Code in Windows and uninstall the Linux version in WSL. You can then use the 'Visual Studio Code' command in a WSL terminal just as you would in a normal command prompt.
Do you want to continue anyways ? [y/N]

解决方法:

这个是 windows 的 vscodewslvscode 冲突了,需要卸载 Liux 系统的 vscode ,则执行以下命令

wsl vscode 和 windows vscode 出现冲突了  install VS Code in Windows and uninstall the Linux version in WSL-新乡seo|网站优化,网站建设_微信公众号:zeropython—昊天博客

让后运行 code 要编辑的文件 则可以正常执行