Enable 256 colors for cygwin under mintty?

I am using cygwin via mintty, which is the default. I installed ncurses. I then run these commands to see what my color pallet is for this terminal session:

$ tput colors
8

I have googled but so far nothing. How can I get a nice 256 color palette for my mintty cygwin terminal instead of the default (lame) 8 colors?


Solution 1:

Try export TERM=xterm-256color or equivalent. You can add that to the appropriate dotfile if you want it to be persistent. You can use a 256-color demo script like this to verify functionality.

Solution 2:

Right-click in mintty, then in Options...->Terminal, change type to xterm-256color, click OK, close mintty and re-launch it.