ANSI Colors in Leopard's Terminal.app

Has anyone figured out a way to customize the ANSI colors in the Leopard Terminal? The TCColorArray plist setting seems to be ignored.
I've even gone so far as to copy the Terminal.app from Tiger onto Leopard. Still no go, even Tiger's terminal is ignoring TCColorArray when running on Leopard (which I find very strange).
Could this be a termcap issue?

The following will rid your Terminal of blue directory listings:
1. Add the following to ~/.profile :
alias ls='/bin/ls -G'
export LSCOLORS=exfxcxdxbxegedabagacad
2. Change the color(s) displayed by `ls` considering the following:
For each pair of characters in the string 'exfxcxdxbxegedabagacad', the first character in the pair represents the foreground color, the second character in the pair represents the background color. Changing the character changes the color; see the following chart:
a black
b red
c green
d brown
e blue
f magenta
g cyan
h light grey
A bold black, usually shows up as dark grey
B bold red
C bold green
D bold brown, usually shows up as yellow
E bold blue
F bold magenta
G bold cyan
H bold light grey; looks like bright white
x default foreground or background
Each character pair in the string 'exfxcxdxbxegedabagacad' represents a type of file displayed by `ls`. The breakdown of character pairs follows:
Pair 1 (ex) - directories
Pair 2 (fx) - symbolic links
Pair 3 (cx) - sockets
Pair 4 (dx) - pipes
Pair 5 (bx) - executable files
Pair 6 (eg) - block special
Pair 7 (ed) - character special
Pair 8 (ab) - executable with setuid bit set
Pair 9 (ag) - executable with setgid bit set
Pair 10 (ac) - directory writable to others, with sticky bit
Pair 11 (ad) - directory writable to others, without sticky bit
So, following this through to conclusion, the following is the list of default color pairs:
ex - blue/default - directories
fx - magenta/default - symbolic links
cx - green/default - sockets
dx - brown/default - pipes
bx - red/default - executable files
eg - blue/cyan - block special
ed - blue/brown - character special
ab - black/red - executable with setuid bit set
ag - black/cyan - executable with setgid bit set
ac - black/green - directory writable to others, with sticky bit
ad - black/brown - directory writable to others, without sticky bit
Finally, to change the listing of directories from blue to cyan, change the first character pair (ex) to (gx) in .profile :
export LSCOLORS=gxfxcxdxbxegedabagacad
3. To have the color change take effect, quit and restart Terminal, or run the following command:
. ~/.profile
Message was edited by: Apple Scruffs

Similar Messages

  • How to permanently save the color settings in terminal.app

    Hi,
    I have configured the "ls" command in the terminal.app to give colored outputs. However, I realised that for some reason the color-set used is designed for a light-colored background. When I use "white on black", the default blue color of the directories is almost invisible.
    Of course, I can change this to another color, but this problem is true for all "blue" fonts, so for example, the default color for comments in vim is also blue and thus unreadable with black background.
    This is not a problem when I use the xterm in X11. The color set there is much lighter and is perfect for a black backgound.
    By drag-and-drop method (drag the chosen color on top of the directory texts in terminal), I am able to alter the blue color to a much lighter version. This apparently changes all fonts that is blue (this includes for example vim comments), and is exactly what I wanted. But I cannot figure out a way to save this as default. Clicking "Save setting as default" button in the inspector does nothing, the new terminal window still gives you this dark blue.
    Anyone know how do I do this?
    Cheers,
    Lianheng

    Hi Nils,
    Thanks for the replies.
    I think I see what the problem is: basically the colors in the terminal are darker than that of the xterm in X11. This can be clearly seen from the vim. May be this is to do with the fact that apple terminal.app has a "better" color support?
    I quite like the default LSCOLORS settings, which is:
    LSCOLORS=exfxcxdxcxegedabagacad
    The color settings in X11 is just perfect for me at the moment. It would be so much nicer if I can make the color scheme in terminal.app look like that of the X11. If say, I change LSCOLORS to
    LSCOLORS=gxfxcxdxcxegedabagacad
    and change the color schemes in vim to a lighter theme, but this will effect the colors in X11 too, which is perfect now. Cyan will look too light in X11.
    At the first I thought by drag and dropping the colors into terminal it will alter its color map. So my question was actually how can one (if it is possible) change the color map of the terminal.app, so that it inteprets the ANSI "blue" slightly differently.
    By the way, the way that you can see all colors in vim is really neat! Thanks for that tip.
    Cheers,
    Lianheng

  • Emacs problem in Terminal.app

    When I edit a text file in the (text-only version) of emacs running in Terminal.app, what happens all the time is that characters in my file get overwritten by spaces (on the terminal only). Pressing Ctrl-L recentres and refreshes the display and it's OK - until it happens again, which is usually right away.
    E.g. if I open the file and press down rightarrow, and hold it for autorepeat, the cursor will gradually move through the file, but as I scroll over certain characters, they will be overwritten by spaces on the screen.
    The problem only happens in Terminal.app, not also in xterm.
    It doesn't matter whether $(TERM) is set to xterm, xterm-color, vt100 etc. in Terminal.app.
    I remember this working in previous versions of Mac OS X, but not in 10.4.5 (and as I recall it's not worked for me for a while).
    Is this a bug? Does anybody else see this? Or is there some setting I might have inadvertently changed.

    The problem was traced to a
    stty -tabs
    line in my .login file. It appears that emacs outputs tabs to move around the screen, and those were being expanded to spaces which overwrote my text. Vi apparently does not use tabs in the same way, which is why the problem was limited to emacs.
    The reason the problem manifested itself in Terminal.app but not in xterm is that tcsh executed inside a new Terminal.app window executes .login, whereas one executed inside a new xterm window does not.

  • Customizing ANSI Colors in Terminal.app

    Has anyone figured out a way to customize the ANSI colors in the Leopard Terminal? The TCColorArray plist setting seems to be ignored.
    I've even gone so far as to copy the Terminal.app from Tiger onto Leopard. Still no go, even Tiger's terminal is ignoring TCColorArray when running on Leopard (which I find very strange).
    Could this be a termcap issue?

    You might want to ask in the Unix forum:
    http://discussions.apple.com/forum.jspa?forumID=735

  • Leopard Terminal.app no longer supports ANSI print escape sequences?!!

    I print my email using pine's "attached-to-ansi" option, which used to work great in Tiger with Terminal.app. It no longer works in Leopard. It also breaks things like the "ansiprt" Unix command.
    This is a start/stop escape sequence that diverts text between the start/stop sequences to the printer. See http://www.termsys.demon.co.uk/vtansi.htm as a reference.
    Is there some Terminal.app setting I need to use to enable this? Some specific terminal type perhaps?
    Suggesting that I use enscript or other techniques don't work, as I use the Terminal to ssh into my mail server, then run pine on the mail server.
    Anyway, any idea how to get this very desirable feature back?
    Thanks,
    -John

    HI,
    I tried to set "Escape non-ASCII input" without any change. I didn't see an option to change "Escape non-ASCII output". I tried a few other things without success either using a different terminal type and so forth. I looked in the .term file and didn't see anything text related to ANSI or ASCII or escape.
    If I change a Terminal preference do I need to quit and restart Terminal to test the change, or does the change take place as soon as I change it in the menu? I tried quitting and restarting after checking "Escape non-ASCII input" and when I restart the box was unchecked. I couldn't find a "save preferences option either.
    In Tiger, my terminal type was xterm-color- same in Leopard. I had checked off "Escape non-ASCII characters" under Tiger.
    Here's exactly what I do, *which used to work in Leopard*.
    I run Terminal.app on my MacBook, and ssh to a mail server. On the mail server, I run the pine command to read my mail. Pine has an option to print email using ASCII escape sequences. Terminal.app sees these escape sequences and diverts the text to the default printer on my MacBook.
    Under Leopard, the Terminal doesn't catch the ANSI escape code, and just spews the text to the terminal window. Nothing has changed on the mail server side. I;m using the sane ssh command.
    Enscript won't work, as the printer connected to the mail server is often as not in a different state than my MacBook.
    Not all terminal emulators support the ANSI print escape sequences. Terminal didn't before Tiger, if I remember correctly. I used to use a very nice terminal emulator called Data Comet which did it.
    ANSI printing used to be a fairly common way to print to a local printer connected to via a parallel cable. Besides pine, the Unix command ansiprt http://kb.iu.edu/data/abye.html could be used to print remote files on the local printer. Some terminal emulator programs used the idea to hook the ANSI escape sequence to the printing system, extending the functionality to use any printer accessible by the local system.
    Thanks again for all your help. I hope I've clarified what I'm trying to do.
    -John

  • Leopard Terminal - No ANSI Colors at all?

    I've done a lot of searching on Terminal colors in Leopard (updated to latest.) I keep coming across fixes to change your colors, but my issue is that my Terminal doesn't display any ANSI colors at all. The terminal configuration works fine, but colors for everything (folders, executables, etc.) are always the same.
    I've tried changing a number of setting, installing the TerminalColors SIMBL plugin, and anything else I could think of, but my color scheme is always monotone.
    infocmp's first few lines:
    # Reconstructed via infocmp from file: /usr/share/terminfo/78/xterm-color
    xterm-color|nxterm|generic color xterm,
    am, km, mir, msgr, xenl,
    colors#8, cols#80, it#8, lines#24, ncv@, pairs#64,
    Please let me know if you have any ideas. Thanks!

    Figured it out.
    "ls -G" does it (duh)
    Don't remember doing this in Tiger, but perhaps I did.
    Added
    alias ls="ls -G"
    to ~/.profile
    to make this automatic.

  • How can I permanently change a text color in Terminal.app?

    According to Terminal's help file:
    "To change the color of the Terminal window or text, drag a color from the Colors window to the Terminal window. If you drop the color on an empty part of the window, the window background changes to the color. If you drop it on text, the text changes to the new color."
    This works like a charm; I drag a lighter blue color onto the dark blue that some distributions of linux display by default when showing a directory in ls and the color changes for the rest of my terminal session in any ls.
    The question is how do I make this change permanent? I tried saving my terminal session into a .term file and opening it, but this change wasn't saved. Everything else was, of course, but not this one.
    Any ideas how to make this sort of change permanent?

    Sorry, but that doesn't address the actual question. I probably was unclear when I asked, so it's my own fault.
    I am not trying to change the color of the cursor, normal text, bold text, or selection. I am attempting to change which color blue shows up when an ansi code for blue is displayed. This can be done by opening the Show Colors interface from the Font menu then dragging the new color to the existing one (so if I have text displayed in Blue that reads "foobar" and I drag aqua onto that text, all Blue text now appears aqua in that Terminal session). The question is how do I make this change permanent?

  • Terminal.app, emacs, and colors.

    newbie here.
    i'm playing around with customizing the (darwinports) emacs' font lock mode in the terminal. i've noticed that not all of the colors display exactly as i expect them. for example, i type "brown" and the result looks just like what i would get if i had typed "red." i assume that the closest match is being displayed from a limited palette.
    is this a problem with Terminal.app or is this a problem with the version of emacs i chose to use? is this a limitation i can correct?
    macbook   Mac OS X (10.4.6)  

    xterm-frobs.el and xterm-256color.el look like possible solutions.
    according to the comment for xterm-256color.el, 21.3 and later should support 256 color terminals. i'm running 21.4.1 but i'm unaware of whether the port is configured to allow this or not. i'll have to check into it.
    thanks again.

  • Keyboard trouble in Terminal.app

    Hello there.
    After using UNIX-like operating systems for many years I finally got a Mac. I use Terminal.app a lot for administrating remote servers over SSH.
    Now I have two problems:
    1. For going to the beginning/end of the line I always have to press "Apple+Home" or "Apple+End". Is there a way to do this just with "Home"/"End"? I figured xterm does it that way an OSX too, but is pretty limited and does not support tabs.
    2. When using an application like vim (locally or on a remote server, does not matter) I cannot use "Apple+Home" or "Apple+End" at all to go to the beginning of the line in the editor window, which is far more annoying and frustrating than the first problem.
    It would be nice if anyone could help me there.
    For now I solved these issues by installing Linux/KDE for administrating/programming on my iMac but it would be nice if I could also get this job done on Leopard.
    Thanks,
    direx

    First, I would point out that there are other terminal emulators available for Mac OS X. I personally use iTerm <http://iterm.sf.net>.
    1. For going to the beginning/end of the line I always have to press "Apple+Home" or "Apple+End". Is there a way to do this just with "Home"/"End"? I figured xterm does it that way an OSX too, but is pretty limited and does not support tabs.
    I guess it all depends on which line you are trying to get to the beginning or end of. For me, it is the bash shell, and for that I just use the supported command line editing commands (which I set to vi mode). The other is the vi/Vim editor and I just use the main keyboard commands for moving to beginning or end of a line.
    But my preference is not yours. I do not have a solution for your desires. Maybe a hotkey mapping utility that translates Home/End into some Terminal key sequences, bypassing the Terminal's grabbing of those keys for scroll back/forward.
    2. When using an application like vim (locally or on a remote server, does not matter) I cannot use "Apple+Home" or "Apple+End" at all to go to the beginning of the line in the editor window, which is far more annoying and frustrating than the first problem.
    Unless Apple+Home or Apple+End send a standard ANSI escape sequence, Vim can not see the key combo.
    If you want to use gvim you might be able to see meta keys that do not have normal ANSI escape sequences.
    If you want to test that a key combo is sending an escape sequence, then run the following command and type away to see what escape sequences are sent
    cat -vte
    If you do not see anything, then the key combo is not sending anything that Vim can see.
    This trick does not apply to gvim.
    NOTE: xterm is an X11 based terminal emulator (on any Unix you care to name). That means it can decide to do additional things with meta keys. Also some xterm implementations even pass mouse position information. Terminal.app more closely resembles a terminal (I'm playing fast and loose with my analogy).
    Message was edited by: BobHarris

  • Problem with font in terminal.app

    Hello all
    I tried to use the font Inconsolata (downloadable from http://www.levien.com/type/myfonts/inconsolata.html) with the terminal.app. Prior to the update to snow leopard everything was alright. But now this font doesn't render anymore in the terminal.app (although it worked once till the next restart also under snow leopard!). Strange thing is, the font works absolutely normal in all other apps (e.g. macvim oder texteditor). So the font seems to be ok. But why does the font not work any more in the terminal.app? Is there a special font-cache for the terminal? I already tried to delete the user and the system font cache.
    A picture might help to understand the problem:
    http://dl.dropbox.com/u/11881979/Bildschirmfoto%202010-09-27%20um%2021.54.47.png
    Some hints on how to remedy this problem?
    Greetings
    Jerri

    That is very strange. OpenType was the format that had the least issues as Apple worked out the early bugs in the complete 64 bit rewrite of the font engine in Snow Leopard. Type 1 PostScript was where the majority of the trouble was.
    As I noted above, I had no trouble with the font, so can only assume there's some sort of issue with your system. At least the TrueType version works.
    The only thing not done was reinstalling the OS. If you want to take the time to try that, back up the drive and run the OS X installer from the desktop. That will put a fresh copy of OS X on the drive while keeping all of your third party apps, preferences and such intact. Then apply all available updates.

  • Dragging tabs from one Terminal.app window to another

    In Safari, you can drag a tab off and "tear" it off from one window to another. Is there a way to make that work in Terminal.app? It doesn't seem to work on my end with Leopard OS X 10.5.5.

    g-pod wrote:
    That worked, thanks! I see what happened now. I tried to detach the tab by dragging the tab upward instead of downward, but didn't drag it up far enough for detachment.
    I discovered the "bug" with Safari - about dragging "up."
    I used the two tab example because it works more easily. But dragging "up" works even when the target terminal has no tab. It's a cool thing
    I suspect that the tab portion of termina (or Safari) only opens when "attacked" from below.

  • Can't open .term Terminal.app files from command line

    Howdy. I use Terminal.app constantly for ssh'ing into numerous remote machines. On my G4 Powerbook I have simply created .term files with customized colors, titlebars, and an appropriate ssh execution string for each machine/userid combination, which I am able to open with "open ~/bin/foo.term". Life is no longer so joyously simple on my new Intel iMac. I create a .term file (via Cmd-s while in a terminal window), but the above command to open foo.term now simply doesn't work on my iMac once a single terminal window has been opened (even after it's been closed) -- I can start one such file only from the finder or via Launchbar or Quicksilver. The only way I can use my .term files is by switching to Terminal and selecting File...Open and clicking on the .term file -- which, being a command line (and Launchbar) junkie, I hate, of course. Applescripts don't work either.
    I would be forever grateful if someone could tell me how to fix this problem!
    txlogic
    Intel iMac Mac OS X (10.4.6)
    iMac   Mac OS X (10.4.6)  

    TXLogic
    I cannot do it either.
    Ah, interesting -- thanks for the input. I had thought the problem might have something to do with the fact that I was using an Intel iMac, but you are using a PPC iBook. The problem isn't with 10.4.6 either, as that is what I'm running on my G4 Powerbook, and the .term files work as expected on that machine.
    Initially I thought it was a
    problem with permissions, i.e the term file hadn't
    the execute bit set (which it did not). Setting the x
    bit though did not help at all.
    Right, the .term files aren't executable.
    A work around was to
    save the command(s) into a plain text document in
    text edit (not rtf) as a .command file (no txt
    extension in this case) and set its execute bit in
    terminal (sudo chmod u+x ...).
    I don't quite understand the workaround -- what command(s) exactly did you put into the .command file? Could you paste the contents of such a file here?
    I have not dealt with term files extensively but I
    noticed that .term files are xml ones. Could anyone
    shed some light in possible changes in the way
    terminal handles them?
    Since the .term files work as desired on my Powerbook, it now doesn't appear that Terminal.app has changed its processing of the files. Something else is going on here.
    txlogic

  • How to use single key to color a message in Mail.app?

    I would like to be able to color code a message's line in the main message summary window by pressing only a single key. In thunderbird, this is accomplished by pressing 1 to 5, each corresponding to a different color.
    Mail.app allows coloring a message, to my knowledge, only by bringing up colors chooser and then selecting a color (by default in a inprecise color wheel).
    How do a make "hot keys" for specific colors?
    thanks

    To answer my own question: Leopard and Mail.app don't suport this directly.
    What works is using Fastscripts Lite to bind application-specific hot keys to some simple applescripts.
    Here is one such script, modeled on an Apple sample script:
    using terms from application "Mail"
    tell application "Mail"
    set selectedMessages to selection
    set selectionCount to (count of selectedMessages)
    repeat with messageNumber from 1 to selectionCount
    set theMessage to item messageNumber of selectedMessages
    set background color of theMessage to green
    end repeat
    end tell
    end using terms from

  • Leopard causes Terminal to load on startup - Please help!

    Hello all,
    I just registered with the forum here hoping someone could help me figure out what is going on with my MacBook Pro after I installed Leopard. After the machine has started up the Terminal app will open a window with the following text in it:
    Last login: Sat Oct 27 21:02:27 on console
    MacBook-Pro:~ Drew$ /System/Library/PrivateFrameworks/SyncServicesUI.framework/Versions/A/SyncServi cesUI ; exit;
    -bash: /System/Library/PrivateFrameworks/SyncServicesUI.framework/Versions/A/SyncServi cesUI: cannot execute binary file
    logout
    [Process completed]
    Also, there is a TextEdit window open with the header "HP Communications" but nothing is in it.
    Neither of these things happened prior to the install while running 10.4 Does anyone have any suggestions that could help. I can close them after startup but it is an issue I want to correct.
    Any suggestions would be greatly appreciated.
    Thanks!

    I'm also using a MacBook Pro, and when I startup Leopard, the Terminal application loads with the following window:
    Last login: Tue Oct 30 08:19:58 on console
    /Library/StartupItems/HP\ Trap\ Monitor/HP\ Trap\ Monitor ; exit;
    You have new mail.
    (my user name is here)ls-computer:~ (my name is here)$ /Library/StartupItems/HP\ Trap\ Monitor/HP\ Trap\ Monitor ; exit;
    /Library/StartupItems/HP Trap Monitor/HP Trap Monitor: line 47: $1: unbound variable
    logout
    [Process completed]
    I have no idea what is causing this, and I would like help also. I'll keep looking. Good luck.

  • Ugh!  Please restore old Terminal.app focus-follows-mouse behavior!

    The 10.4 and prior Terminal.app's focus-follows-mouse feature allowed one to type into the terminal by mousing over it even if the Terminal wasn't the currently focussed application. It didn't focus Terminal when you did this, but did direct keyboard input to it.
    10.5's Terminal.app only allows focus follows mouse to work when it's the focussed application, which destroys about 80% of this feature's usability for me. I like to keep things like finder and browser windows overlapping most of a terminal window and then just slide the mouse over to the terminal to type there, and I can no longer do that in 10.5. Now I have to click on the Terminal window, bringing all my terminal windows forward and obscuring the windows I wanted on top. Very annoying.
    Is there any way to restore the old behaviour? If not, can we please have it back?
    Luckily, 10.4's Terminal.app still behaves properly in 10.5, so I'm using it, but I'd like to have some of the new features of 10.5's Terminal.app. Unfortunately, "broken" focus-follows-mouse is a deal-breaker for me.

    The command I know,
    defaults write com.apple.Terminal FocusFollowsMouse -string Yes
    seems to work about the same in Leopard as in Tiger for me. I don't remember ever being able to get focus-follows-mouse behaviour to work in a non-active application from an active non-focus-follows-mouse application. In other words one can focus follows mouse from one Terminal to another, but not from Finder to Terminal.
    The X11 equivalent (why the inconsistent key and value?) is
    defaults write com.apple.X11 wm_ffm -bool true
    I remember being able to focus-follows-mouse between Terminal and X11, but cannot in Leopard. However, I also cannot in Tiger 10.4.11 either, so maybe it is my memory that is faulty.
    What I don't seem to be able to do, but could do in Tiger, is
    defaults write com.apple.X11 swapaltmeta -int 1
    On Tiger, that would make the option key the meta key, so that e.g. alt-d would delete forward one word, etc. On Leopard, this seems to be a NOP which means that cmd is the only possible meta key, which I personally find rather confusing.

Maybe you are looking for

  • Font appears different in Muse (without smooth anti aliasing)

    I am using Google Font Roboto and noticed that it appears thicker when i type it in Muse than in Photoshop. When i have anti-aliasing on 'Strong' in photoshop it mirrors what is showing in Muse, but i prefer the default Smooth anti-aliasing. Is there

  • Trying to understand the SJAS package-appclient utility.

    Hi, I have a few questions about the package-appclient script. I have no problem getting it to work, but there are a few things that don't make sense to me. I want to use a professional looking installer (I grabbed a demo of install4j and really like

  • Problem with Time handeling - again, please help

    I've some difficulties with handeling Date and time. I'm reading the date and Time seperately from a file as string. Now I need to calculate the difference between two times (both are in string format). Same problem for the date. I need to calculate

  • What is going on with universal updater?!!!!!!

    hey i cant figure this out please anyone, i just got this ipod and im new to it... i was trying to update it because the little folder with a ! mark came up and thats what the troubleshooter said to do.. so i downloaded the universal updater and when

  • Customizing the DVD ROM content

    Hi, I added in the DVD ROM content of one of my film photos from iPhoto. I have a few issues I want to resolved: - The folder is named with the name of my iDVD file, and not with the name of my iDVD Project (in Project/Project info). Anyway to force