25

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?

Zombies
  • 3,792
  • 11
  • 46
  • 60

2 Answers2

31

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

Yaakov
  • 793
  • 4
  • 9
  • 2
    It's also `Term=xterm-256color` in .minttyrc. Anyway this should be the right answer for Cygwin mintty – wbkang Jun 03 '17 at 20:29
25

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.

jjlin
  • 15,462
  • 4
  • 51
  • 51
  • 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 05: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. – Armen Michaeli 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