On 2/28/2026 1:57 AM, Fergus Daly via Cygwin wrote:
I am completely drowned by the volume and complexity (and in some cases
antiquity) of responses when googling [variations on]
"xterm color": e.g. multiple references to all of .Xdefaults, .Xresources,
.xinitrc and much much more.
I do not have any of these. Using xterm within Cygwin the file
/etc/X11/app-defaults/XTerm seems to serve all required purposes relating
to color. I have (comments # below are not part of the file):
xterm*color3: orange # for selected text using Find/Replace in nano
xterm*color10: darkgreen # for binaries and any *.sh using ls
xterm*color12: blue # for folders using ls
xterm*color13: maroon # for sockets using ls
xterm*color14: brown # for links using ls
xterm*color1: purple # cant find any instances of these 4 being
used but often see them in online examples of XTerm
xterm*color2: tan
xterm*color6: yellow
xterm*color11: red
Question 1 I'm not inclined to mend what isn't broken but do others find this
file and its location a convenient or even a
recommended way to control the palette?
It's usually not recommended to change the system wide file in /etc. The
preferred
method is to override using your individual .Xresources or .Xdefaults.
Question 2 I think there are 16 settings available (xterm*colorNN, 1 to 16) but
nowhere have I been able to find a reference describing
what each controls. Can anybody please point me to such a reference?
color0 through color15 set the 16 colors that will be used for the colors of
the 16-color ANSI color scheme. There are escape codes that programs can send
to the terminal to select the foreground and background color for text written
after the color change. The 16 are considered to be 8 normal intensity colors
and 8 "bright" versions of the same colors. The colors (I think in order) are
black, red, green, yellow, blur, magenta, cyan, and white. Applications use
them as they will, and which color they use for what may or not be controllable,
depending on the application.
Question 3 In minty not xterm I get pretty much the same thing (sockets are
shown purple not maroon; selected text in Find/Replace in
nano is shown red not orange), but think this is just coincidental.
I have no idea where mintty in Cygwin (or bash - all different again) get their
colors from. Please can anybody say?
First, I think you're focusing on the colors that ls uses (which is fine), but
the
colors done by number in the xterm configuration files actually apply to all
applications.
Just so you know, xterm also supports a 256-color scheme and 24-bit RGB
(red/green/blue)
color scheme, which covers the full palette of many (most?) screens.
As for ls, you can also instruct it as to which color to use for what. See man
ls
and man dircolors. Here's a web page about dircolors:
https://www.bigsoft.co.uk/blog/2008/04/11/configuring-ls_colors
Basically, you use dircolors to help get a setting for the LS_COLORS
environment variable.
LS_COLORS is easily customized once you have a starting value. It indicate the
color for
ls to use when coloring a wide range of file types, etc.
The colors for mintty are controlled in ~/.minttyrc. It appears to work
somewhat
differently from xterm but to give the same level of control.
Thank you!
No problem. You can find a lot more on the web, though I admit it helps to
know how
to frame the question :-) ...
HTH, and now a response will be in the archive for the future. Eliot Moss
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple