Enable 256 colors for cygwin under mintty?

19,561

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.

Share:
19,561

Related videos on Youtube

sarath
Author by

sarath

Updated on September 18, 2022

Comments

  • sarath
    sarath over 1 year

    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?

    • CMCDragonkai
      CMCDragonkai almost 10 years
      If you use mintty, you can apparently set the terminal type to xterm-256...
  • Sridhar Sarnobat
    Sridhar Sarnobat over 9 years
    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.
  • Xandrmoro
    Xandrmoro about 9 years
    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.
  • dlamblin
    dlamblin over 8 years
    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.
  • Cammy Boy
    Cammy Boy almost 7 years
    It's also Term=xterm-256color in .minttyrc. Anyway this should be the right answer for Cygwin mintty