# Colors in Terminal



## rloaderro (Sep 19, 2005)

This probably sounds flakey, but I can't figure out how to get colors or font-weights to display in Terminal. For purely usable reasons it would be a hella useful if directories, for example, displayed differently from files when I enter "ls".

I've tried setting the Terminal Type in Prefs and fooling with the colors in Window Settings but everything still displays the same font / weight.

Any suggestions please?

edit: This would be on Tiger


----------



## mdnky (Sep 20, 2005)

Launch Terminal.app
Open _Preferences_ and set "Declare terminal type ($TERM) as:" to *x-term-color*
Restart Terminal.app

To change colors open _Window Settings_ and choose _ANSI Colors_.  Make changes until you're happy (easy way is to keep a terminal window open and to the root drive and visible...you'll see the changes as you hit apply in the open window).  When satisfied, *make sure you hit the "Use Settings as Default" button* at the bottom before closing.  That'll stick the changes to all future windows.


----------



## rloaderro (Sep 21, 2005)

Well, it is set to xterm-color by default. Even so I tried changing it to something else > quitting > changing it back and restarting. Still...

_To change colors open Window Settings and choose ANSI Colors._

There is a tab called "Color" but no ANSI Color - there is only an option to *disable* ANSI Color. The color settings that are available only effect text, bold text, selected text and the cursor. The thing is nothing ever appears in bold. So basically I have all text looking the same. I know ANSI colors should work because "vim" for example displays in color. Do you think it might depend on the font? I use Monaco 10pt.

Thanks!


----------



## ksv (Sep 21, 2005)

Colors and font-weights do display in the Mac OS X terminal, but ls doesn't use that by default in OS X. You can use the -G option to specify ls to use color and -F to append a slash after directories to make them distinguishable. 'man ls' also contains some fun


----------



## rloaderro (Sep 21, 2005)

Hey that's really cool - thanks! This brings about another question though. How could I have 'ls' always use these options without having to type them? I could write a script I guess, name it 'ls' and place it in the $PATH with higher priority than /usr/bin (just guessing here) - but how do I get it to execute without having to type './' or 'sh' first - or I am completely on the wrong path here and is there another, better way to achieve this?


----------



## mdnky (Sep 21, 2005)

rloaderro said:
			
		

> There is a tab called "Color" but no ANSI Color - there is only an option to *disable* ANSI Color.


I was looking at this an trying to figure out why you couldn't see the _ANSI Colors_ option, when it finally hit me.  There's a plugin (SIMBL) called TerminalColors that I have installed which gives that option.


----------



## atrain (Sep 28, 2005)

there is a custom ls around with proper color support...
all you have to do is make an alias in your .bashrc....
EG:

alias ls='~/.hidden_ls_file --options'
alias name='action' <-- works with anything!

make sure you have .bash_profile though


----------



## btoneill (Sep 29, 2005)

actually all you need to do is:
<code>
alias ln=`ls -FG`
</code> 

and stick that in your .bash_profile file (or create one if it doesn't exist). 

Brian


----------



## atrain (Sep 29, 2005)

Hmm... they stuck a color ls in tiger??

Im used to 10.2 / .3 at school (they had budget to only upgrade ram or switch to tiger, went for ram due to comp's usages - video editing)


----------



## ElDiabloConCaca (Sep 29, 2005)

Color worked in 10.3, too.


----------

