colored terminal

berny868

Registered
hi

is it possible to have a colored terminal in OS X like a color X-Term under X11 ?
can only be some settings in a rc file, but what are they?

thanks
 
It is really easy to make your text in the terminal use color. Go to www.gnu.org or any site that has file-utils and then install those. After, edit your .cshrc file (or .bashrc if you are using bash) and type this in it:

alias ls ls --color

then open a new terminal and you should see color!

Justin
 
Yeah, Apple has chosen to not include any software licensed under the GPL in their distribution. Perhaps they're concerned about any small possibility that it might obligate them to publish the source to anything else.

What I've _really_ been missing is a way to define the actual colors Terminal.app uses to display the sixteen different ansi values. Most good terminals will allow you to do this, which makes colorization much more useful. No more squinting at dark-blue-on-black! No more wincing at that yellow!

Unfortunately, a year of looking hasn't show any support for this at all in Terminal.app. I'd be thrilled if someone could show me such a thing...
 
Originally posted by onan
What I've _really_ been missing is a way to define the actual colors Terminal.app uses to display the sixteen different ansi values. Most good terminals will allow you to do this, which makes colorization much more useful. No more squinting at dark-blue-on-black! No more wincing at that yellow!

Unfortunately, a year of looking hasn't show any support for this at all in Terminal.app. I'd be thrilled if someone could show me such a thing...

there is a small application which comes as part of the FileUtil package.

dircolors

You may use it like this

<b> setenv LSCOLORS /etc/dircolors</b>

in your ~/Library/init/tcsh/environment.mine

make it if it is not there

read /usr/share/init/tcsh/README
and other files there for hints about customizing your shell.

also /etc/csh.cshrc has an interesting line in it...

if you want further customization you may either
write something in your environment.mine such as.....
<blockquote>
setenv LS_COLORS "no=00:fi=00:di=09;33:ln=04;34:pi=04;33:*.dylib=04;03;31"
setenv LS_COLORS "${LS_COLORS}:so=01;35:bd=03;32;03:cd=03;34;02:eek:r=30;01;31"
setenv LS_COLORS "${LS_COLORS}:ex=03;36:*.tar=04;03;30:*.tgz=03;02;30"
setenv LS_COLORS "${LS_COLORS}:*.arj=01;31:*.taz=01;31:*.lzh=01;30"
setenv LS_COLORS "${LS_COLORS}:*.zip=35;01;30:*.z=01;31:*.Z=01;30:*.gz=04;03;30"
setenv LS_COLORS "${LS_COLORS}:*.d*=01;30:*.jpg=01;35:*.gif=04;32"
setenv LS_COLORS "${LS_COLORS}:*.pl=06;31:*.ppm=01;35:*.tga=01;35"
setenv LS_COLORS "${LS_COLORS}:*.xbm=01;35:*.xpm=01;35:*.ti*=01;34"
setenv LS_COLORS "${LS_COLORS}:*.txt=09;33:*.pdf=02;36:*.gl=03;37:*.dl=01;37"
setenv LS_COLORS "${LS_COLORS}:*.mine=03;36:*.html=02;34:*.cgi,*.?html=03;34"
</blockquote>

which is separated into separate lines as some text editors hate realllllly long lines.

here is an excerpt of the help from
dircolors
<blockquote>

"# Below are the color init strings for the basic file types. A color init",
"# string consists of one or more of the following numeric codes:",
"# Attribute codes:",
"# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed",
"# Text color codes:",
"# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white",
"# Background color codes:",
"# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white",
"NORMAL 00 # global default, although everything should be something."
<hr>
Output commands to set the LS_COLORS environment variable.<br>
<br>
Determine format of output:<br>
-b, --sh, --bourne-shell output Bourne shell code to set LS_COLORS<br>
-c, --csh, --c-shell output C shell code to set LS_COLORS<br>
-p, --print-database output defaults<br>
--help display this help and exit<br>
--version output version information and exit<br>
<br>
If<b> FILE</b> is specified, read it to determine which colors to use for which<br>
file types and extensions. Otherwise, a precompiled database is used.<br>
For details on the format of these files, run `dircolors --print-database'


</blockquote>
 
thanx jimr, that was very informative.


i just downloaded a pre-compiled ls and added stuff to the environment.


dani
 
I'm afraid that's not what I had meant.

I'm familiar with the ways to get ls to use different particular ansi codes for different things, and that does indeed work normally with Terminal.app.

What I want, however, is to be able to change the actual colors which Terminal.app uses to depict various ansi codes. For example, change that hideous yellow to be something less glaring, and change both blues to be something actually legible against a black background.

It's extremely handy to be able to constructively use _all_ the various "colors", rather than just the two or three which are legible. This functionality exists in every X11 terminal application I've ever used, and would probably exist within Terminal.app, had it been updated any time in the last fifteen years.
 
Hi,

I'm actually trying to get my X11 term colored.
I'm using bash shell.

I've set TERM to xterm-color

Now, I've read 'ls' man page, and I can config LSCOLORS to have my term colored, but I would like to specifiy my own file extension color, and not only the category of file describe in the man pages.

So I try to use dircolors from coreutils-5.2.0.

But it doesn't work :
eval `dircolor mycolor_file -b` return me LS_COLORS and not LSCOLORS.
and LS_COLORS is not understand by 'ls'.

Have you any idea about this ?

Thanks.
 
Back
Top