Jethro Hazelhurst
Jethro Hazelhurst

Reputation: 3285

(Windows 10) GitBash not formatting colors - can't find configuration settings

Background

My GitBash command line is not showing colors or formatting and seems to be escaping characters... e.g.

The Entity shortcut name: CarBundle:Car
C[K7arBundle8a[K7rBundle8r[K7Bundle8B[K7undle8u[K7ndle8n[K7dle8d[K7le8l[K7e8e[K:[KC[Ka[Kr[K

After doing some digging I found this solution:

For displaying escaped characters, please try changing Git Bash options for terminal to "xterm-256color" by Right Click on Terminal > Options > Terminal > Type > xterm-256color

Question

I honestly can't find this configuration setting at all... this is the closest I have come...

enter image description here

How do I implement the solution above?

Upvotes: 4

Views: 7012

Answers (2)

Josef Wittmann
Josef Wittmann

Reputation: 1339

For anyone having the same problem and finding this thread:

This solution worked for me on Windows 10:

Was helped in another thread - Created a windows system variable FORCE_COLOR and had it set to true, did not restart, and now I have colors in Git Bash (windows 7)

Upvotes: 1

VonC
VonC

Reputation: 1323403

A Windows CMD does not interpret ANSI escape sequences.

You can follow "ANSI color in Windows shells" and download ansicon, install it with ansicon -i (uninstall with ansicon -u): that would be for Windows 7.

Windows 10 does have support for ANSI colors, but note that with recent version of Windows 10, that might not work, as seen in this issue.

The problem is that for Windows 10.0.10586 it was enabled by default, but with Windows 10.0.14393 (Anniversary Update) it must be explicitly enabled by the program.

Try using your git commands in a CMD instead of a git bash.
By adding to your %PATH% the <path/to/git>\usr\bin folder, you will still be able to benefit from Linux commands without having to enter a git bash.

Upvotes: 2

Related Questions