visual-studio-code - Visual Studio (VS-code) 代码终端无法启动
问题描述
我试图编译一个程序,但终端没有打开。
error:The terminal process failed to launch: Starting directory (cwd) "D:\vs code\march long 2020" does not exist.
这家伙有同样的错误,但弹出是不同的链接
下面是我的 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": [
]
}
请参阅此链接以获取完整的错误描述,我编写代码并编译并收到错误消息。 关联
解决方案
此设置破坏了我的终端窗口(因为 powershell 因公司管理员而被阻止):
之后我无法再次打开终端。
将 CMD 恢复为默认值
更改 VS Code 设置中的路径:
- 打开首选项 > 设置 (CTRL+,)
- 搜索
terminal.integrated.shell.windows
- (其他操作系统替换
windwos
为linux
orosx
)
- 点击
Edit in settings.json
- 设置CMD路径
"terminal.integrated.shell.windows": "C:\\windows\\System32\\cmd.exe",
现在终端应该再次打开。这不是让 Powershell 在 VS Code 中工作的修复程序,只是恢复终端窗口的指南。
2021 年 9 月更新(附加设置)
搜索terminal.integrated.defaultProfile.windows
并设置默认值(对我来说命令提示符)
推荐阅读
- python - 根据条件将数据框列添加到列表中,如果它是 1,那么它应该在列表中,否则不在
- spring-boot - http post data:端点json解析丢失的kotlin数据类字段的默认值
- java - 在 Netbeans 中将 javadoc 附加到库的 .jar
- sql-server - 我必须在插入之前停用索引吗?
- java - 在 lambda 表达式的上下文中,“提供委托”是什么意思?
- swift - 从阻塞回调创建发布者
- flutter - 在 Flutter 中意外删除了 dart 包
- google-apps-script - Google 应用脚本、Gmail 应用 HTML 正文未正确显示并向电子邮件添加签名
- caching - Web 缓存如何减少接收请求对象的延迟?
- python - windows机器上的python版本不匹配