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.
Related videos on Youtube
Author by
sarath
Updated on September 18, 2022Comments
-
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 almost 10 yearsIf you use mintty, you can apparently set the terminal type to xterm-256...
-
-
Sridhar Sarnobat over 9 yearsThis 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 about 9 yearsA "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 over 8 yearsSo 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 me256
. -
Cammy Boy almost 7 yearsIt's also
Term=xterm-256color
in .minttyrc. Anyway this should be the right answer for Cygwin mintty