Skip to content

Instantly share code, notes, and snippets.

@redleafar
Created February 12, 2018 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redleafar/0c93ead162565211b7e157d1bbb9d71a to your computer and use it in GitHub Desktop.
Save redleafar/0c93ead162565211b7e157d1bbb9d71a to your computer and use it in GitHub Desktop.
Strange characters in CMD

https://stackoverflow.com/questions/35387667/git-bash-is-displaying-strange-characters-on-windows-7

Having used git on windows for over three years now, I’ve fallen back in love with the command line. Bash, of course, not the windows command prompt. Beautiful, ubiquitous, warty bash. Git depends heavily on GNU utilities so on Windows it requires either cygwin or msys. Having been burned by cygwin in the past, I prefer the minimalism and simplicity of msys + mingw. Along with git, the entire ruby ecosystem lives in the shell. However, the numerous tools, gems and utilities that assume standard ANSI color support in the shell began to wear on me. Lo and behold, there is a lovely solution to provide ansi color support for bash (and cmd) on Windows: ansicon.

Download the zip and extract (https://github.com/adoxa/ansicon/downloads). There are a few ways to install:

Extract to a permanent location (I use C:/bin/ansicon). Execute ansicon.exe -i from within the appropriate directory for your system (x86/x64), and you’re all set. Any new shells (bash and windows cmd included) will autorun the ansicon utility for displaying color output. Be sure not to move the executable prior to running ansicon.exe –u. This removes the registry entry and prevents an ugly error message for every command shell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment