Clean and cute console on OSX

This article will help you customize the Console application to have cute colors and prompt. It is a sequel to the very nice article provided by Todd Werth on his blog.

Let’s begin this article by directly showing you the expected result:

Result console 1

As you noticed, we change the color and informations displayed at the prompt, as well as the main colors of the console. These changes are reflected in other terminal applications such as vim.

Result console 2

Okay, so the first thing to locate, is your .bash_profile file in your home directory. If the file does not exists, just create it.

This file contains command lines that are executed when launching a new Console window. So you can just start by typing them directly in the terminal to test it before adding it to your .bash_profile

Bash configuration

We are now going to activate some nice features of bash. For instance, we would like to have completion working case insensitive.

bind "set completion-ignore-case on"     # Ignore case during command line completion
bind "set bell-style none"               # Disable bell
bind "set show-all-if-ambiguous on"      # Show all possibilities with a single tab

Custom promt

Now it’s time to set up a clean prompt. The only informations we need is the current folder, and login.

export PS1="\e[40;32m\u \e[40;34m\w \e[40;37m➤ \e[0m \[${COLOR_NC}\]"

There are a number of options for configuring a nice prompt. Here are some escaped sequences and their equivalents:

Enabling colors

In the quest of having nice colors in the Console application on Leopard, you’ll need to install SIMBL. Once done, just add the following line to enable colors:

export CLICOLOR=1;   # Enable colors in terminal