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

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?

  • If you use mintty, you can apparently set the terminal type to xterm-256... – CMCDragonkai Jun 4 '14 at 1:11

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.

  • 6
    Worked, thanks: i.imgur.com/MKlwTGK.png – Zombies Apr 3 '14 at 14:48
  • This worked for me too. But I can't get it to work over SSH to Windows from my Mac iTerm2. It does work with the same settings when I SSH to an Ubuntu box. – Sridhar Sarnobat Nov 19 '14 at 5:06
  • 2
    A "dotfile" being any file starting with a dot, I would at least advise to NOT set TERM variable in dotfiles that are related to your shell, as opposed to dotfiles related to your terminal emulator program. This is because a shell may be used with multiple terminal emulators, and setting TERM there is obviously a misplacement mistake, an all too common one I am afraid. If you are going to override TERM value, the proper place to do so is not in a shell dotfile, but a terminal emulator dotfile, if there is one, in this case something like ~/.minttyrc. I hope I have made myself clear. – amn May 21 '15 at 10:53
  • 1
    So if in mintty I have TERM set to xterm-256color and I run that script and I only get some very slow output of solid black lines, what does that mean I should do about fixing it? tput colors tells me 256. – dlamblin Oct 26 '15 at 20:45

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

  • 1
    It's also Term=xterm-256color in .minttyrc. Anyway this should be the right answer for Cygwin mintty – wbkang Jun 3 '17 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.