enable ls output coloring in iTerm2 or iTerm?

4,331 views
Skip to first unread message

Arsalan

unread,
Dec 21, 2010, 8:24:12 PM12/21/10
to iterm2-discuss
Hi,

I am new to iTerm. I changed my terminal emulation to xterm-new and
xterm-256color. Still the command "ls -G" is not coloring the output
for me. Any suggestions?

Thanks!
Arsalan

yokull

unread,
Dec 22, 2010, 7:27:06 AM12/22/10
to iterm2-discuss
first thing:
dwld the perl script here and test to make sure you can view all 256
http://vim.wikia.com/wiki/VimTip1312

Arsalan

unread,
Dec 22, 2010, 11:44:10 PM12/22/10
to iterm2-discuss
Hi yokull,

Thanks for the reply. I run the xterm-color script and it is printing
out colors. Also in my vim I am seeing colors after syntax on. Well
still ls -G is not printing out any colors in the output and I am
looking for a way to see my file listings in colors.

Any other suggestions?

Thanks,
Arsalan


On Dec 22, 7:27 am, yokull <yokullvzk...@mailinator.com> wrote:
> first thing:
> dwld the perl script here and test to make sure you can view all 256http://vim.wikia.com/wiki/VimTip1312

yokull

unread,
Dec 23, 2010, 8:11:15 PM12/23/10
to iterm2-discuss
i am having "similar" issues too (i have colors, but not 256)

what is your shell? zsh? bash? fish?

are you running .login or .bashrc scripts?

what happens when you run terminal.app? do you have colors visible
there?

Gavin Sinclair

unread,
Dec 24, 2010, 8:23:01 AM12/24/10
to iterm2-...@googlegroups.com
On Friday, December 24, 2010 12:11:15 PM UTC+11, yokull wrote:
i am having "similar" issues too (i have colors, but not 256)


Forgive this silly question, but what does ls show in 256 colors that it doesn't show in 16?

I have colorful ls, but (probably) only 16 colors, even though I have 256-color vim.

It would be nice if ls used color to indicate file size (by highlighting the size -- e.g. 14M, 213B -- not the filename).

Gavin 

yokull

unread,
Dec 24, 2010, 9:37:39 AM12/24/10
to iterm2-discuss
hi gavin,
not a silly question at all
again, i'm unsure if i'm even explaining it right

here it is in terminal.app:
http://cl.ly/2e2n463x0j3I2k1x1F0f

and here it is in iterm2:
http://cl.ly/2P0h0H0P2V1V0s33003Z

note the "testing" in the left prompt in iterm appears as white rather
than grey, as well as the blue being more bright

i should upload my prompt command as well as my colorset to see if it
could be reproduced...

thnx

Gavin Sinclair

unread,
Dec 24, 2010, 9:45:26 AM12/24/10
to iterm2-...@googlegroups.com
On Saturday, December 25, 2010 1:37:39 AM UTC+11, yokull wrote:

here it is in terminal.app:
http://cl.ly/2e2n463x0j3I2k1x1F0f

and here it is in iterm2:
http://cl.ly/2P0h0H0P2V1V0s33003Z

note the "testing" in the left prompt in iterm appears as white rather
than grey, as well as the blue being more bright


The differences in color between iTerm2 and Terminal could be explained by the color settings in each application.

Terminal is showing _different_ colors, not _more_ colors.

How do you know ls _does_ take advantage of 256 colors?

(Sorry if this ground has been covered or if I should be googling instead... I'm going on my background knowledge here.)  

George Nachman

unread,
Dec 24, 2010, 11:12:31 AM12/24/10
to iterm2-...@googlegroups.com
On Fri, Dec 24, 2010 at 6:45 AM, Gavin Sinclair <gsin...@gmail.com> wrote:
On Saturday, December 25, 2010 1:37:39 AM UTC+11, yokull wrote:

here it is in terminal.app:
http://cl.ly/2e2n463x0j3I2k1x1F0f

and here it is in iterm2:
http://cl.ly/2P0h0H0P2V1V0s33003Z

note the "testing" in the left prompt in iterm appears as white rather
than grey, as well as the blue being more bright


The differences in color between iTerm2 and Terminal could be explained by the color settings in each application.


FWIW, you can log your output and look for the escape sequence:
<ESC>[38;5;#m

replacing # with a number from 0 to 255. 
 

Gavin Sinclair

unread,
Dec 24, 2010, 7:10:11 PM12/24/10
to iterm2-...@googlegroups.com
On Saturday, December 25, 2010 3:12:31 AM UTC+11, George Nachman wrote:
FWIW, you can log your output and look for the escape sequence:
<ESC>[38;5;#m

I certainly don't get that.  I just get the plain color codes: <ESC>[31m etc. 
Message has been deleted

yokull

unread,
Jan 31, 2011, 11:06:22 AM1/31/11
to iterm2-...@googlegroups.com
just an update on my issue and its "solution":
i found out that i had  the "draw bold text in bright colors" option enabled, which pretty much turned some of my light grey text invisible
stumbled upon that by accident

EDIT:
the ANSI colors option for the bright column had the same setting as my terminal background
and all my bright color settings looked like primary colors to me, hence my thinking that i wasn't getting full 256 color glory
genius at work here....

George Nachman

unread,
Jan 31, 2011, 2:33:35 PM1/31/11
to iterm2-...@googlegroups.com
Ah, that is good to know. Thanks for following up with an explanation. In the next release of iTerm2, there will be a "minimum contrast" option that ensures text is always visible which would have helped.

yokull

unread,
Feb 1, 2011, 10:08:24 AM2/1/11
to iterm2-...@googlegroups.com
plus there seemed to be quite a number of settings turned "on" by default that i didn't think of at the time
maybe the defaults should have the bold and bright settings off? (maybe they were and i accidentally toggled them on)

and the "bright" settings could be at defaults where they aren't white or black
i have my background set at full white, and i imagine most others have theirs set at full black

thnx again

George Nachman

unread,
Feb 3, 2011, 2:18:31 AM2/3/11
to iterm2-...@googlegroups.com
It would be great to get a log of the ls output that caused you problems. Could you do Shell->Log->Start, perform the ls operation that yielded white-one-white, Shell->Log->Stop, and send me the log? My ls isn't colored, and I'd like to see what you experienced.

Thanks,
G
Reply all
Reply to author
Forward
0 new messages