vscode内打开终端报错,提示异常退出${0}

2023-08-01  本文已影响0人  一苏沨来

vscode终端打开报错,那是需要配置下正确的软件路径了

原因

vscode终端在 Windows 上使用的 shell 是powershell,但打开报错,所以这里需要更改

vscode终端在 Windows 上使用的 shell 的路径
(默认: C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe)

修复

切换默认终端为cmd
1.vscode内ctrl+shift+p打开命令面板,输入select ,选中Terminal:Select Default Shell

2.选中你想切换的(powershell或cmd其中一种),重新打开控制台(完成)

直接修改settings.json也可以

只需要在 VS Code 的 settings.json 中加入一句

//vscode默认
"terminal.integrated.shell.windows": "C:\\windows\\System32\\cmd.exe"

自定义vscode的终端路径,默认版和自定义版全改

//默认
"terminal.explorerKind": "external",
"terminal.external.windowsExec": "C:\\windows\\System32\\cmd.exe",
 //自定义
"terminal.integrated.shell.windows": "C:\\windows\\System32\\cmd.exe"

最后

运行右键cmd打开属性,可以找到cmd软件位置

上一篇 下一篇

猜你喜欢

热点阅读