Make Your Terminal Easy to Read

What terminal theme do you currently use? Do you find sometimes it’s hard to find a specific line in your screen?

I used to use normal terminal, but it’s really hard for me to find information in an all text environment.

Screen Shot 2015-02-08 at 3.24.34 PM

I first changed my theme to Homebrew (from preference)

Screen Shot 2015-02-08 at 3.25.43 PM

Black background and green text made my eyes feel better. But I thought there should be a better way to distinguish between username, file directory, status, etc.

Therefore, I researched and found a way to make using terminal easier.

Screen Shot 2015-02-08 at 3.32.37 PM

Here is how to do it:

1. Go to your home directory

2. Open your .bash_profile

3. Decide the color you like. Here is the color I used.

# colors!
green="\[\033[0;32m\]"
purple="\[\033[0;35m\]"
reset="\[\033[0m\]"
GREENBOLD="\[\033[1;32m\]"

You can find more color options here.

4. Export your  Bash’s prompt (PS1)

# '\u' adds the name of the current user to the prompt
# '\$(__git_ps1)' adds git-related stuff
# '\W' adds the name of the current directory
export PS1="$GREENBOLD\u$green\$(__git_ps1)$purple \W $ $reset"

That’s it. Save your .bash_profile and restart your terminal. Now you have a pretty terminal that you can enjoy using. Let’s code some more!

Leave a Reply

Your email address will not be published. Required fields are marked *