|
#1
| |||
| |||
| 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. |
|
#2
| ||||
| ||||
| 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 |
|
#3
| |||
| |||
| 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! |
|
#4
| ||||
| ||||
| 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. |
|
#5
| |||
| |||
| 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? |
|
#6
| ||||
| ||||
| Quote:
__________________ . | 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. |
|
#7
| |||
| |||
| 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 |
|
#8
| ||||
| ||||
| 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 |