我试着编译一个程序,但是终端不能打开。
error:The terminal process failed to launch: Starting directory (cwd) "D:\vs code\march long 2020" does not exist.此人有相同的错误,但弹出窗口的link不同
下面是我的vscode的JSON文件
{
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"C_Cpp.updateChannel": "Insiders",
"files.autoSave": "afterDelay",
"java.saveActions.organizeImports": true,
"window.zoomLevel": 0,
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"terminal.integrated.windowsEnableConpty": false,
"json.schemas": [
]
}查看此链接以获取完整的错误描述,我编写了代码并进行了编译,得到了错误消息。link
发布于 2020-09-02 19:19:30
此设置会中断我的终端窗口(因为powershell由于公司管理员的原因而被阻止):

之后我就不能再打开终端了。
将命令还原为默认
更改VS代码设置中的路径:
用于terminal.integrated.shell.windows
windwos或linux替换linux

click CMD >单击Edit in settings.json
"terminal.integrated.shell.windows": "C:\\windows\\System32\\cmd.exe",

现在终端应该再次打开。这不是让Powershell在VS Code中工作的修复,只是恢复终端窗口的指南。
更新2021年9月(附加设置)
搜索terminal.integrated.defaultProfile.windows并设置默认值(适用于我命令提示)

发布于 2020-08-01 19:19:39
我也面临着同样的问题,但我找不到解决方案,我得到了不同的解决方案。
例如:- "terminal.integrated.shell.windows":"C:\Program Files\Git\git-bash.exe“。注意:-路径包含双反斜杠(\)。
发布于 2021-01-16 09:04:08
看起来您正在尝试获取VS Code集成终端上的Powershell。
让我来分享一下我是如何做到的。
终端>集成: Cwd将在其中启动终端的显式启动路径,用作shell进程的当前工作目录(cwd)。如果根目录不是一个方便的cwd,这在工作空间设置中可能特别有用。
终端>集成>外壳: Windows终端在Windows上使用的外壳的路径(默认:
单击settings.json编辑
)
的原因
"C:\InstallationDirectory\PowerShell\7\pwsh.exe“:
”terminal.integrated.shell.windows“
尽情享受
https://stackoverflow.com/questions/63202834
复制相似问题