默認的輸出中文會顯示成亂碼,需要在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?