TLDR: What is the theory behind terminal colors?
I have a fixed value of LS_COLORS in numbers:
no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;33:*.cmd=00;33:*.exe=00;33:*.com=00;33:*.btm=00;33:*.bat=00;33:*.sh=00;33:*.csh=00;33:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:*.c=00;41:*.cpp=00;41:*.h=00;44:*.cu=00;43:*.cuh=00;43:ex=00;32
I wonder what causes gnome-terminal, urxvt and yakuake to show perceptibly different colors for the same file type? The difference ranges from very similar (and yet clearly different) to drastically different- brown vs yellow.
Similarly, there are differences in how vim color shows up, I see very different colors in all three terminals. Both when t_Co=8 (vim supporting 8 colors) and t_Co=256(vim supporting 256 colors).
What's worse is that when I copy .XResources from internet which has english names for colors, the same colorscheme in vim shows much different colors. (I think I can attribute this to the use of names in vimscheme, and color redefintion by .Xresources)
Could someone help me with understanding the theory behind how terminal color works? A link would work great. If someone's feeling extra generous- maybe they can give tips too to ensure that I always have a standard environment, specially in the context of vim?
I should note that on yakuake, my color theme is: "Linux theme" (which seems to be only standard theme) and on gnome-terminal I have no theme. When I check the 'user system colors' option, the colors are even more disastrous, and the output itself is mangled (e.g. vanilla ls
showing each file on a different line). For urxvt, the only color related fields I have defined in .Xresources and xrdb -q
yields are:
Urxvt.background: #000000
Urxvt.foreground: #FFFFFF
Ok so some screenshots to explain what I'm talking about (first is on yakuake, second on urxvt)
The difference is clearly major...
Using: http://www.vim.org/scripts/script.php?script_id=1349 (first is yakuake, second on urxvt)