默认的输出中文会显示成乱码,需要在vscode内部的终端中输入
chcp 65001
缺点是需要每次打开vscode进行激活,另一种方式是在vscode的首选项中进行配置:
"terminal.integrated.shellArgs.windows": ["/K", "chcp 65001"]
(无效请尝试以下配置)
"terminal.integrated.shellArgs.windows": ["-NoExit", "/c", "chcp.com 65001"]
详见:How to set Integrated Terminal default encoding to UTF-8?