Git Pills: customize your Windows Git shell, MinTTY

Git for Windows comes with the delicious MinTTY console emulator.
Unfortunately, the prompt is not a think I like too much, nor the colors…
Here some tips to customize your MinTTY experience.

When opening a Git Bash console in Windows, what appears to you is something like this:

In green there is username@computer, an information you generally don’t need to see every command…
Then there is another thing, maybe more unuseful then the one before, that is the MINGW64 fuchsia string: even here, we know we are using MinGW toolset, so I find  seeing it at every line quite tedious.

To customize the prompt of your MinTTY, you have to modify this file:

C:\Program Files\Git\etc\profile.d\git-prompt.sh

This is the file where we can set-up the PS1 Bash environment variable.
As you can see, I commented out the line where user and host are shown, then I did the same for the $MSYSTEM one.

Having done this, now my prompt is now more polished:

Other than this, as you already may know, there is an Options menu where you can setup some more configurations about MinTTY; just click on the top-left icon to open it:

Here you can setup many things, like font and so on; take five minutes of your time and try them up to find your perfect balance.

But there’s another little thing we can do.
As you can see in the picture above, there’s a “Theme” combobox, but usually it is empty.
While MinTTY settings will be stored in a .minttyrc file in your user’s folder (e.g. C:\Users\<username>\.minttyrc), to take advantage of themes you have to create here a .mintty folder, and a themes subfolder to collect them  (e.g. C:\Users\<username>\.mintty\themes).

To create a dotfolder in Windows, simply put a dot even at the end: after giving the OK, only the first dot will remain.

You can download some new color schemes form here:

Put these files in themes folder then restart MinTYY and try to apply some of them: you will find for sure someone you like.

Happy versioning with your brand new MinTTY shell! :)

 

Leave a Reply

Your email address will not be published. Required fields are marked *