Thursday, January 18th, 2007

Color terminal under Mac OS X

Filed under: — Daniel Lemire @ 13:45

One thing that annoys me since I started using Mac OS X is that there is no color in the terminal. So I added the following lines to my .bashrc file:


export TERM="xterm-color"
alias ls="ls -G"
PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] ”

For some reason, I also had to add the following line at the end of the global bashrc file (/etc/bashrc) so that my user bashrc file is read:


. ~/.bashrc

See also my post I have had it with Firefox under MacOS.

Subscribe to this blog
in a reader
or by Email.

3 Comments »

  1. FYI, here is my PS1:

    export PS1=”[\[\e[33m\]\u@\H \[\e[32m\]\w\[\e[0m\]]\n[\[\e[31m\]\!\[\e[0m\]] > “

    Comment by Peter Turney — 18/1/2007 @ 17:00

  2. I’m pretty sure that in the normal course of events, bash reads your .bash_profile on login. Most .bash_profile files then source the .bashrc

    Ex .bash_profile:

    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc
    fi

    Comment by phil — 20/1/2007 @ 0:26

  3. login shells read .bash_profile
    non login shells read .bashrc

    Comment by whiteknight — 26/3/2007 @ 9:28

RSS feed for comments on this post.

Leave a comment

Warning: When entering a long comment, please ensure that you make copy of your text prior to submitting it. If the server should fail or if you hit a bug, you might lose your work. I am not responsible for your lost effort.

To spammers: I carefully review every single post and make sure that spam gets deleted. You are wasting your time if you are manually entering spam using this form. Read my terms of use to see what I consider to be abusive.

Example: I + II + IX= XII. Yes, you have to enter a roman numeral. (Answer must be in upper case.)

« Blog's main page

30 queries. 1.095 seconds. Valid XHTML

Powered by WordPress

Subscribe to this blog in a reader or by Email.