在setting.json文件中加入以下代码后重启vscode即可。
//解决中文乱码
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"overrideName": true,
"args": ["-NoExit","/c","chcp 65001"],
"icon": "terminal-powershell",
"env": {
"TEST_VAR":"value"
}
}
},
加入后的文件: