Mik*_*emo 6 terminal visual-studio-code
几天前,我假设微软发布了 VSCode 的新更新,当我开始构建我的 esp idf 项目时它不起作用,因为它依赖于在执行“特殊”项目构建命令之前从终端运行的命令,我得出的结论是,允许自动出现在“设置”中的文件 main.code.workspace 中的以下设置是:
"terminal.integrated.shell.windows": "cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k",
"C:/Coding/ESP32/esp-idf/export.bat"
],
Run Code Online (Sandbox Code Playgroud)
错误如下:
这已被弃用,配置默认 shell 的新推荐方法是在 中创建终端配置文件
#terminal.integrated.profiles.osx#并将其配置文件名称设置为#terminal.integrated.defaultProfile.osx#. 目前这将优先于新的配置文件设置,但将来会发生变化。
在启动时配置默认终端并运行此命令的新方法是什么?
sun*_*sun 12
在 settings.json 文件中,我们需要有以下内容
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
}
},
Run Code Online (Sandbox Code Playgroud)
并通过添加设置默认终端
"terminal.integrated.defaultProfile.windows": "Command Prompt",
Run Code Online (Sandbox Code Playgroud)
我们可以通过按 Ctrl + Shift + P 并搜索终端来实现这一点:选择默认配置文件并选择所需的外壳。
但是,尽管已弃用,但您目前拥有的设置现在应该可以使用。
小智 8
我已经解决了这个问题
1)将Git/bin添加到环境变量中的路径中
2)重新启动VSC并在settings.json中添加以下内容
"terminal.integrated.profiles.windows": {
"PowerShell": { "source": "PowerShell", "icon": "terminal-powershell" },
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"icon": "terminal-cmd"
},
"GitBash": {
"path": ["F:\\Program files\\Git\\bin\\bash.exe"],
"icon": "terminal-bash"
},
},
"terminal.integrated.defaultProfile.windows": "GitBash",
Run Code Online (Sandbox Code Playgroud)
只需将“GitBash”路径中的“您的 git bash 路径”替换为“GitBash”即可
3)删除旧设置
对我来说是
"terminal.integrated.shell.windows": "F:\\Program files\\Git\\bin\\bash.exe"
Run Code Online (Sandbox Code Playgroud)
4)保存设置,按删除关闭VSC终端,重新启动VSC
希望这有效!
| 归档时间: |
|
| 查看次数: |
7178 次 |
| 最近记录: |