1.在vscode中打开文件-->首选项-->设置,在setting.json中编辑。
2.将以下代码粘贴到setting.json文件并保存。
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell", //一般推荐使用powershell
"overrideName": true,
"args": ["-NoExit", "/c", "chcp 65001"],
"icon": "terminal-powershell",
"env": {
"TEST_VAR": "value"
}
}
},
"terminal.integrated.defaultProfile.windows": "PowerShell",