VS Code更新后设置defaultProfile.windows为Command Prompt仍默认打开PowerShell
VS Code更新后终端默认启动PowerShell问题解决方案
解决步骤
- 第一步:补充终端profile显式定义
VS Code的terminal.integrated.defaultProfile.windows参数依赖terminal.integrated.profiles.windows中对应名称的配置项,你当前未配置该定义,会导致系统无法正确识别Command Prompt的启动路径,自动回退到PowerShell。
在settings.json中添加如下配置,保留你原有"terminal.integrated.defaultProfile.windows": "Command Prompt"的配置即可:
"terminal.integrated.profiles.windows": { "Command Prompt": { "path": "C:\\WINDOWS\\System32\\cmd.exe", "args": [] } },
- 第二步:排查工作区配置覆盖
工作区配置(当前项目下.vscode/settings.json)优先级高于全局配置,如果上述配置添加后仍不生效,检查该文件中是否存在终端默认Shell相关配置,修改为对应值或者删除冲突配置即可。 - 第三步:兜底自定义配置方案
如果仍存在系统别名识别问题,可以自定义profile名称避免冲突,示例如下:
"terminal.integrated.profiles.windows": { "CustomCmd": { "path": "C:\\WINDOWS\\System32\\cmd.exe", "args": [] } }, "terminal.integrated.defaultProfile.windows": "CustomCmd",
所有配置修改完成后重启VS Code即可生效。
内容的提问来源于stack exchange,提问作者gene b.
相关产品推荐
相关产品推荐

