Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you set the 16 Terminal Colors for Git-Bash?

Is there a different way to set the 16 terminal colors for git-bash? Ideally, I'd like to know the location of a config file so that editing is easier, and the settings are portable.

It seems the only way I can see so far is to manually edit the boxes from the properties window, but this is buggy and tedious - you can't use hex strings, and selecting the color to inspect it sometimes alters the color wildly.

Properties Window

Since git-bash is an old version of mintty, I tried altering my .bashrc their way, but that failed to work as well. Any hints would be appreciated.

like image 760
Redoubts Avatar asked Oct 04 '22 05:10

Redoubts


1 Answers

Console colors are stored in the registry under HKCU/Console/[window name]/ColorTable00-15.

[window name] is either "Git Bash" for the start menu entry or something like "C:_Program Files (x86)_Git_git-cheetah_.._bin_sh.exe" for the Windows Explorer context menu entry (supplied by Git-Cheetah).

Alternatively, the registry settings can be overridden by storing an NT_CONSOLE_PROPS structure with appropriate ColorTable settings in the "Git Bash.lnk" shortcut via IShellLinkDataList::AddDataBlock. This happens e.g. if you edit the properties of a console window started via shortcut, or if you edit the shortcut properties directly.

If you want the values from the registry instead, create a new "Git Bash.lnk" shortcut from scratch and leave the Options/Font/Layout/Colors tabs alone.

like image 150
Karsten Blees Avatar answered Oct 07 '22 20:10

Karsten Blees