image
image

|


Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old September 19th, 2005, 08:07 PM
Registered User
 
Join Date: Apr 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
rloaderro is on a distinguished road
Colors in Terminal

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

Last edited by rloaderro; September 19th, 2005 at 08:22 PM.
Reply With Quote
  #2  
Old September 20th, 2005, 05:26 PM
mdnky's Avatar
[Bobs/Prog/Design:~] mod%
 
Join Date: Jul 2001
Location: Baton Rouge, LA - USA
Posts: 2,638
Thanks: 0
Thanked 0 Times in 0 Posts
mdnky is on a distinguished road
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.
__________________
.
| mdnky@macosx.com | My Homepage | My Music | Restore the Pledge | MacOSX.com Widget |

• MacBook Pro Core2Duo 2.33GHz 15", 2GB DDR2 RAM, 120GB, DL Superdrive, OS X 10.5,
• Apple 23" Cinema HD Display, Apple Slim-Stainless Keyboard, Logitech Optical Scroll Mouse
• iPhone 8GB, iPod Photo 30GB, Nikon D50, Nikon L6, Epson 3490, Epson R1800, HP LaserJet 1200
• LaCie 500GB d2 Quadra, LaCie 160GB d2 FW, harman/kardon SoundSticks II, Mighty Mouse, iSight

Reply With Quote
  #3  
Old September 21st, 2005, 03:13 PM
Registered User
 
Join Date: Apr 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
rloaderro is on a distinguished road
Except

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!
Reply With Quote
  #4  
Old September 21st, 2005, 04:28 PM
ksv's Avatar
ksv ksv is offline
liberal socialist
 
Join Date: Nov 2000
Location: Trondheim, Norway
Posts: 3,000
Thanks: 0
Thanked 0 Times in 0 Posts
ksv is on a distinguished road
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
__________________
leo at code.coop

Co-operatives are private corporations based on the values of self-help, self-responsibility, democracy, equality, equity and solidarity.
Reply With Quote
  #5  
Old September 21st, 2005, 04:41 PM
Registered User
 
Join Date: Apr 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
rloaderro is on a distinguished road
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?
Reply With Quote
  #6  
Old September 21st, 2005, 10:43 PM
mdnky's Avatar
[Bobs/Prog/Design:~] mod%
 
Join Date: Jul 2001
Location: Baton Rouge, LA - USA
Posts: 2,638
Thanks: 0
Thanked 0 Times in 0 Posts
mdnky is on a distinguished road
Quote:
Originally Posted by rloaderro
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.
Attached Files
File Type: pdf Terminal.pdf (22.5 KB, 12 views)
__________________
.
| mdnky@macosx.com | My Homepage | My Music | Restore the Pledge | MacOSX.com Widget |

• MacBook Pro Core2Duo 2.33GHz 15", 2GB DDR2 RAM, 120GB, DL Superdrive, OS X 10.5,
• Apple 23" Cinema HD Display, Apple Slim-Stainless Keyboard, Logitech Optical Scroll Mouse
• iPhone 8GB, iPod Photo 30GB, Nikon D50, Nikon L6, Epson 3490, Epson R1800, HP LaserJet 1200
• LaCie 500GB d2 Quadra, LaCie 160GB d2 FW, harman/kardon SoundSticks II, Mighty Mouse, iSight


Last edited by mdnky; September 21st, 2005 at 10:49 PM.
Reply With Quote
  #7  
Old September 28th, 2005, 02:58 PM
Registered User
 
Join Date: Sep 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
atrain is on a distinguished road
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 :P
Reply With Quote
  #8  
Old September 29th, 2005, 04:23 PM
btoneill's Avatar
keeper of the cheese
 
Join Date: Jul 2002
Location: Minneapolis, MN
Posts: 797
Thanks: 0
Thanked 0 Times in 0 Posts
btoneill is on a distinguished road
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
__________________
UNIX is simple and coherent, but it takes a true genius (or a programmer at any rate) to understand and appreciate its simplicity -- Dennis Ritchie
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 07:35 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.