xterm-256 support for git bash

1.9k Views Asked by At

I am trying to enable xterm 256 color via git bash. It turns out there are 2 ways to start a git bash in Windows.

  • windows cmd, run this git-cmd.exe --command=usr/bin/bash.exe -l -i
  • mintty, run git-bash.exe

However seems only the second one support 256 color. The following screenshot is executing result of cat AnsiColors256.ans AnsiColors256.ans. enter image description here

But the downside of git-bash.exe is that it can't be integrated into integraded command line tool like ConEmu, as indicated on ConEMU Doc

Also, you may run in ConEmu tab git-bash.exe, but this is not recommended, because it runs mintty.exe, which is another terminal.

It actually start an new window instance.

My question is, is there any tweak to config cmd.exe to support 256 color like mintty.exe? I still want to use a single ConEMU instance for all my command line interfaces.

I am using windows git version git version 2.24.0.windows.2

1

There are 1 best solutions below

1
VonC On

It actually start an new window instance.

a simple "bash" would not start a new windows.

As for the CMD.exe, you might consider using instead the new Microsoft Terminal, as Microsoft/Terminal, which is more likely to support 24-bit colors.