# Terminal.app in color?



## 033 (Mar 28, 2003)

I have no color when using ls at all. Is there anyway to turn it on? I've tried ls --color. Same.. just the colors set in terminal preferences.

I have color when I run BitchX, but the ansi characters are messed up. There's a lot of sideways triangles with ? marks in them.

When I ssh to my webserver (redhat 8) ls is in full color. 

I've tried http://www.macosxhints.com/article.php?story=20020408225741777 but when I ls .terminfo/v I get file not found. (there's a file called 76 in there)

Any ideas??

Mac OS X 10.2.4
Set to use /usr/bin/login (i've tried /usr/bin/csh)


----------



## Giaguara (Mar 28, 2003)

Open terminal. Choose -- from the menu bar, up -- terminal  >> window settings >> color. There you can choose the default colors and transparencies, ansi colors etc.

If you want e.g. the prompt color different from the rest of the text, then this could be useful.. It explains how to set e..g prompt colors (and other features for the prompt). (Well - I have red bold prompt and all the other text in plain black, including links, mutt etc.)

For all the ??? and other charachters - you probably have the wrong keymap enabled. You can change it somewhere in terminal menu - (I can't find it right now; it has to be in preferences or somethign like that) - try with the other keymap settings.

Vim (www.vim.org) has more than vi has ~ like the color .. that could be worth trying as well?


----------



## 033 (Mar 28, 2003)

No I already saw the color prompt post. 

All I want is my 'ls' to be colorized. I don't really care if BitchX's ansi characters are messed up.. that's like a 2nd priority.


----------



## Giaguara (Mar 28, 2003)

You can get color support by building the GNU Fileutils and using its "ls" instead of the default.

curl -O http://ftp.gnu.org/pub/gnu/fileutils/fileutils-4.1.tar.gz
gnutar xzf fileutils-4.1.tar.gz
cd fileutils-4.1/
./configure
make

If you want all the utilities,  do the "sudo make install". If all you want are the directory listing color capabilities, you could just replace the default "ls" with the new one:

sudo mv /bin/ls /bin/ls.OFF
sudo cp src/ls /bin/ls

To update your man page for ls:

sudo mv /usr/share/man/man1/ls.1 /usr/share/man/man1/ls.OFF.1
sudo cp man/ls.1 /usr/share/man/man1/ls.1

You could add an alias to your ".login" file 

echo 'alias ls "ls --color" ' >> .login

Bash does not provide ls with color support.


----------



## Giaguara (Mar 28, 2003)

"ls --color"  

The color codes  are in the LS_COLORS shell variable. If you want to customize the colors, you need to set this variable, and assign some filetypes and colors to it. The dircolors command simply executes the following command:

setenv LS_COLORS 'no=00:fi=00:di=01;34:ln=01;36i=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01r=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jpg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.png=01;35:*.mpg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:'

(without line breaks)


This is from a Linux guide for setting ls colors and could be useful too:



> LS_COLORS
> The format of this variable is reminiscent of the termcap(5) file format; a
> colon-separated list of expressions of the form "xx=string", where "xx" is a
> two-character variable name. The variables with their associated defaults are:
> ...


----------



## 033 (Mar 28, 2003)

I compiled gnu ls.. and set the ls_colors and now ls --colors works. 


Only thing left is .login doesn't get read...

I have the following inside .login:

alias ls "ls --color"


----------



## 033 (Mar 28, 2003)

Nevermind.. I moved it into .tcshrc and it worked.

One weird thing I noted... when I put set prompt or alias commands after the LS_COLORS command.. they wouldn't work. I put them before and it works fine. WEIRD... I now have a color ls, color prompt...... yay!  Thanks for your help.


----------

