color ls in terminal?

synaptojanin

Registered
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.
 
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.
 
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.)
 
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.
 
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]
 
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.
 
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?
 
Back
Top