前段时间vscode启动终端突然闪退,粗略排查原因说是与电脑上的某些软件有关,因为不想卸掉,就直接改用系统终端。但是慢慢的还是觉得vscode内集成的终端用起来比较方便,于是又开始研究,寻找解决方案。
首先描述一下问题,vscode 启动终端闪退,软件内提示‘The terminal process failed to launch: Windows cannot open this program because it has been prevented by a software restriction policy. For more information, open Event Viewer or contact your system Administrator.’
根据错误提示到vscode 官网 Docs 下查看相关描述,找到了解决方案,步骤如下:
1、打开vscode的设置:File->preferences->setting
2、搜索栏输入 ‘terminal.integrated.shell’搜索
3、Terminal>Intergrated>Default Profile: Windows 项的下拉框的null值改成Git Bash或者是Command Prompt
4、我可以愉快的继续使用vscode了
猜想不同系统出现此类问题应该是需要修改Terminal>Intergrated>Default Profile 不同项下的配置文件
贴个图: