windows - 如何解决 bash 编码问题?

标签 windows bash git-bash

我在 git bash (Windows 8.1) 上的每个命令上都得到这种类型的输出

在每个命令上,我的输出都有一些未解决或编码问题。如何解决这个问题?

←[37;41m
   ←[39;49m
←[37;41m  [PDOException]
       ←[39;49m
←[37;41m  SQLSTATE[HY000] [2002] No connection could be made because the target
machi  ←[39;49m
←[37;41m  ne actively refused it.
       ←[39;49m
←[37;41m
       ←[39;49m

bash 实际截图

enter image description here

最佳答案

那不是未解析的编码,那些是 shell 颜色代码(请参阅下面 mklement0 的评论以获得精确描述)。 您需要在 shell(例如 cygwin 上的 bash)下运行它,以便它解释颜色。

通过运行禁用颜色:

git config --global color.ui false

关于windows - 如何解决 bash 编码问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35908590/

相关文章:

c++ - boost_1_60_0 .zip 在 Windows 中的安装

linux - 即使页面不存在,Wget 也会创建输出文件

git - 如何将 TAG 添加到 Git 和 Bitbucket 中已经提交的

visual-studio-code - Visual Studio 代码 : Use Git Bash (windows)

windows - 如何在 Windows 10 的 VSCode 上使用 IBMPlexMono-Italic 字体?

C++ 进程监控 (GetExitCodeProcess)

c++ - 如何更改在 Windows 中加载服务的顺序?

linux - 从后台脚本运行 SSH

bash - 如何从 bash 脚本正确启动 ejabberdctl?

command-line-interface - 等效于Windows 8.1的wget命令行