我想在visual studio代码中使用cmd打开目录,但它在cmd中给我错误.那么,需要什么设置呢?
我执行了以下命令
D:\RND>code .
Run Code Online (Sandbox Code Playgroud) 我通过编辑 settings.json 文件将 Windows 上的 bash 添加到 Windows 终端,当我尝试编译用 c++ 编写的简单 hello world 时,它会抛出错误,未检测到 gcc 或 g++ 如何正确添加 MSYS bash 终端,以便我可以从 Windows 终端编译文件
在 settings.json 中,我添加了 bash shell 的路径,如下所示:
{
"commandline": "powershell.exe",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"name": "Windows PowerShell"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"commandline": "C:\\msys64\\usr\\bin\\bash.exe -i -l",
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "msys2"
},
{
"guid": "{495d29da-4bfb-4956-abd8-ed1760703232}",
"commandline": "cmd.exe",
"hidden": false,
"name": "cmd.exe"
}
Run Code Online (Sandbox Code Playgroud) 我正在将 VS Code 与 WSL 一起使用。要在 WSL 中编辑代码,我需要导航到 WSL 中的目录,然后code .在同一目录中键入以打开 VS Code。它以前可以工作,但突然间我无法使用此命令。我收到错误zsh: command not found: code。
我尝试过的事情: