解决Windows下VS Code终端输出乱码的问题

290 阅读1分钟

网上找了很多方法都不行,最后验证了本方法,简单有效,还没有副作用。

尽量不要通过修改操作系统的语言设置,因为可能会影响一些其他软件乱码

1.  打开“设置”->“时间和语言”->“区域”->“其他日期、时间和区域设置”->“更改日期、时间或数字格式”->“管理”->“更改系统区域设置”。
1.  勾选“使用Unicode UTF-8提供全球语言支持”。

本方法如下:

一般开发同学都会装git,使用下面的方式很方便,不需要做其他多余的配置。

打开“设置”-›Settings

image.png

搜索terminal.integrated.profiles.windows,选择Edit in settings.json

image.png

将terminal.integrated.defaultProfile.windows的Value修改为Git Bash。(terminal.integrated.profiles.windows下的Git Bash内容应该已经存在了,如果没有请补充。)

{
  "terminal.integrated.profiles.windows": {
    "Git Bash": {
        "source": "Git Bash"
  },
  "terminal.integrated.defaultProfile.windows": "Git Bash"
}