# color ls in terminal?



## synaptojanin (Oct 7, 2000)

Does the terminal app support color listings? typing:
     <fixed>$ ls --color</fixed>
gives no complaints, but also no color.
Configuring .bashrc or .tcshrc with an alias similarly yields no result.  launching an xterm in xtools and running ls --color chokes, making me think that the variant of BSD doesn't have color ls.  Has anyone else looked into this?  I really need color ls.


----------



## The DJ (Oct 7, 2000)

> _Originally posted by synaptojanin _
> *Does the terminal app support color listings? typing:
> .............
> making me think that the variant of BSD doesn't have color ls.  Has anyone else looked into this?  I really need color ls.
> *



The terminal supports color. I get color listings, when ssh into the university server, which i configured in .bashrc to use color.

This version of ls on OSX indeed does not support color ls. I remember that someome ported this, but i don't know who and where anymore, i'll be looking for it.


----------



## 512ST (Oct 7, 2000)

a ported color ls is available at <http://www.10k.org/~jake/>. i haven't tried though.


----------



## 512ST (Oct 7, 2000)

> _Originally posted by 512ST _
> *a ported color ls is available at . i haven't tried though. *



oops. something went wrong with that url. color ls is here: http://www.10k.org/~jake/


----------



## synaptojanin (Oct 7, 2000)

> _Originally posted by 512ST _
> *
> 
> 
> ...




Excellent! Your help is most appreciated!


----------



## The DJ (Oct 7, 2000)

> _Originally posted by 512ST _
> oops. something went wrong with that url. color ls is here: http://www.10k.org/~jake/ [/B]



That was the port i meant. Thank you 512ST

DJ


----------



## LunaMorena (Oct 8, 2000)

> _Originally posted by The DJ _
> *This version of ls on OSX indeed does not support color ls. I remember that someome ported this, but i don't know who and where anymore, i'll be looking for it. *



That's because color in ls is a linux invention, and it's something that BSD doesn't support without additional installation.  it does the color ls just fine when I telnet into my linux box.  (Unfortunately it doesn't show the colors in vim but that's probably because I have something configured incorrectly that lets vim know that I'm using a color terminal.)


----------



## p940e (Oct 23, 2000)

Thanks alot.  I was wondering about that.


----------



## p940e (Oct 23, 2000)

Thanks alot.  I was wondering about that.


----------



## amosb (Oct 23, 2000)

> *Unfortunately it doesn't show the colors in vim but that's probably because I have something configured incorrectly that lets vim know that I'm using a color terminal.*



as a <tt>vim</tt> junkie, i cannot live without color and thus have spent years honing the most precise vimrc possible.  to get color in <tt>vim</tt> (version 5 or higher) on almost any platform (including OS X), the first however many lines in your <tt>~/.vimrc</tt> should be:

<pre>#### everything you need for color ####
version 5.x

set ttytype=vt100
if has("terminfo")
  set t_Co=8
  set t_Sf=^[[3%p1%dm
  set t_Sb=^[[4%p1%dm
else
  set t_Co=8
  set t_Sf=^[[3%dm
  set t_Sb=^[[4%dm
endif

syntax on
#### end color settings #############</pre>

let me know if it doesn't work.


----------



## dani++ (Oct 23, 2000)

works like a champ!

thanx... but though my path has '/Users/dani/bin' (where i've put the coloured ls) before '/usr/bin', direct 'ls --color' invocation does not call the new one. If i provide the full path it works perfectly.

I would only like to set it up without actually aliasing 'ls'
That would pave the way for any other user-specific commands...

thanx,

dani++


[Edited by dani++ on 10-23-2000 at 07:14 PM]


----------



## amosb (Oct 26, 2000)

> _Originally posted by dani++ _
> *thanx... but though my path has '/Users/dani/bin' (where i've put the coloured ls) before '/usr/bin', direct 'ls --color' invocation does not call the new one. If i provide the full path it works perfectly.
> 
> I would only like to set it up without actually aliasing 'ls'
> That would pave the way for any other user-specific commands...*



Do you still have this problem?  My only guess is that if you are trying to run it in a terminal that was opened before you installed, it didn't see it in your path.  Try running <tt>rehash</tt>, which forces your shell to rescan your path and see what commands are available.  (or you could just close all your open shells.)

let me know if that doesn't work.


----------



## MacInLew (Oct 27, 2000)

I tried both the ls and the .vimrc and can not get either one to work. I tried rehash, exit and re-launching Terminal. I had to create a bin directory in my user directory, and the.vimrc file. My path does show my bin directory even though there was no such directory until I created it.
Help?


----------

