首页 > 解决方案 > 将 MINGW64 集成到 Visual Studio 代码中

问题描述

https://code.visualstudio.com/docs/editor/integrated-terminal,我已经能够将 shell 放在 shell 选项中,但是当我选择它时,它会弹出一个与 VSCode 终端分开的新窗口。我该如何解决这个问题?

这就是我在settings.json中所做的:

"terminal.integrated.profiles.windows": {
...
"MINGW64": {
            "path": "C:\\msys64\\mingw64.exe"
        }
}

我也有问题git。我从msys2安装了git作为一个包。我已经设置了所有基本参数。git config

但是当我尝试时git config --global -e,它给出了一个错误:

hint: Waiting for your editor to close the file... code --wait: line 1: code: command not found error: There was a problem with the editor 'code --wait'.

所以我在cmd中进行了尝试,它起作用了。where code也只在cmd工作。

所以我想知道会是什么问题。会不会有什么关系PATH?还是与上述问题有关?

标签: gitterminalvscode-settingsmingw-w64msys2

解决方案


所以我在cmd中尝试了它,它起作用了。其中代码也只能在 cmd 中工作。

除了它code.cmd是实际执行的。
在 bash 会话中,检查$PATH引用是否与 CMD 中的文件夹相同。

还可以考虑直接使用Git For Windows:您可以将其添加git bash到 VSCode

在 .bashrc 中:

export PATH=$PATH:"/C/Users/User1/AppData/Local/Programs/Microsoft VS Code/bin"

推荐阅读