OSX Lion terminal lost all colors
Solution 1
I had to edit ~/.profile and put this code in to make folders color.
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
I used this to make a custom cursor:
PS1='\[\033[01;32m\]\u@macair\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
Hope this helps.
For vim, use a theme like this theme
And add 2 folders, ~/.vim and ~/.vim/colors
Put the theme file in your ~/.vim/colors folder
Then make a file called ~/.vimrc with something like this:
syntax on 'this is needed to see syntax
set background=dark "makes it easier to read with black background
colorscheme ir_black "set theme in ./vim/colors folder
set ls=2 " allways show status line
set hlsearch " highlight searches
"set incsearch " do incremental searching
set ruler " show the cursor position all the time
set visualbell t_vb= " turn off error beep/flash
set ignorecase "ignore case while searching
set number 'put numbers on side
I've added comments so you can pick and choose what you want. Also, I ended up tweaking the theme. It made comments grey and they were too hard to read.
Solution 2
You need add these settings on your .vimrc
filetype on
filetype plugin on
filetype indent on
syntax on
To enable your color highlighting.
I was using my .vimrc
, which does not have these, but works in Linux and old OS X versions. For Lion, you need add them.
Solution 3
I have the following in my ~/.profile
function parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\*\1/'
}
case "$TERM" in
xterm-*color) color_prompt=yes;;
esac
if [ "$color_prompt" = yes ]; then
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[0;33m\]$(parse_git_branch)\[\033[00m\]\$ '
else
PS1='\u@\h:\w$(parse_git_branch)\$ '
fi
Related videos on Youtube
ajackbot
Updated on September 18, 2022Comments
-
ajackbot almost 2 years
I recently upgraded to Lion only to find that Terminal.app (and iTerm2, which I actually use instead) have totally lost all colors. This means no syntax highlighting in Vim, no colored directory names or filenames, no nothing. I've tried playing around with the terminal-type option in the preferences (for both apps), changing it to
xterm-256color
,xterm-new
,xterm
, etc. but all to no avail.However! When I SSH into a remote machine in Terminal.app, I get colors! Everything works as it once did. Although this isn't the same with iTerm2, where I'm still left colourless.
-
skub almost 13 yearsI've been able to get the prompt to have colors by adding code to the ~/.profile file, but I'm not sure where the code for the folders goes. I only do this once a year or so... This didn't work for me, maybe you? blog.toddwerth.com/entries/13
-
drewrockshard almost 13 yearsIf when you state "I'm not sure where the code for the colors go" you mean LSCOLORS, then maybe you should check out softwaregravy.wordpress.com/2010/10/16/ls-colors-for-mac. I'm assuming that you mean the colors for when you perform an
ls
on a directory and you see different files and folders, and you are wanting to change the color of the folder. -
skub almost 13 yearsI added some info to that effect supplemental to my first answer.
-
-
ajackbot almost 13 yearsThis partially works and does show colours when doing an
ls
for example. Still no coloring anywhere else in the shell though (e.g. in Vim) -
skub almost 13 yearsYou have to add the colors to vim the same way. I just did it. You need folder ~/.vim/colors/whatevertheme.vim and you need a ~/.vimrc file that specifies that you want to use the whatevertheme.
-
Achilles over 11 yearsThis is amazing!