Home > dircolor, howto, mac osx > Mac OS X Lion terminal color (remote access) problem fix

Mac OS X Lion terminal color (remote access) problem fix

After upgrading to Lion I noticed that the Homebrew theme that I’ve been using since Snow Leopard doesn’t display colors correctly(using different colors for directories, different types of files etc.) any more when working on remote hosts via ssh (local dir colors still work though) and switching to other themes doesn’t help. After messing around with the Terminal settings I finally found the cause and a solution. It seems Lion changed the terminal type to xterm-color256 during the upgrade (don’t remember what the setting was in SL though). The solution is simple enough, just change the emulation type for terminal from xterm-color256 to xterm-color (see screenshot below).

[ Update 1/2/2012 ]
Actually found a better solution here:
1. Keep the current xterm-256color in your Mac Terminal
2. Add the following lines to your ~/.profile on your remote host

[ "$TERM" = "xterm" ] && TERM="xterm-256color"
alias ls='ls --color'

3.
. ~/.profile

Advertisement
Categories: dircolor, howto, mac osx
  1. terminal guy
    July 24, 2011 at 8:35 am | #1

    nice, it annoyed me too

  2. GervaisdeM
    July 28, 2011 at 2:23 pm | #2

    Thanks! It was annoying me, but not enough to start poking around to find the answer until today.

  3. Craig Gold
    July 29, 2011 at 6:02 am | #3

    THANK YOU! This worked perfectly!

  4. August 9, 2011 at 3:42 am | #4

    Bless you :-) What didn’t Lion mess with?

  5. Daniel Regalado
    August 11, 2011 at 6:49 am | #5

    Where can i find this at? like the steps..

    • ricoch3n
      August 11, 2011 at 12:10 pm | #6

      Sorry should have put down the details
      1) Launch Terminal
      2) Click Terminal on the top left of the screen
      3) Choose Preferences
      4) Your current theme should be selected by default in the theme list
      5) Click Advanced tab on the top right of the dialog
      6) Under Emulation, choose “xterm-color” as the value for the “Declare terminal as” dropdown
      7) Restart Terminal application, that should be it

  6. Valerie
    August 12, 2011 at 5:07 pm | #7

    I followed the awesome steps but my color is still of and some fonts seem unfinished. Any ideas? Eyes getting super squinty ;)

    Thanks!

  7. August 30, 2011 at 11:20 pm | #9

    thanks thanks thanks!

    • ricoch3n
      August 31, 2011 at 12:54 am | #10

      You are very welcome. Glad it helps.

  8. Ulf
    September 22, 2011 at 12:57 pm | #11

    Thanks for this hint :).

    • November 21, 2011 at 3:06 pm | #12

      indeed that did the job. Many thanks

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.