Simple Tricks to Improve the Terminal Appearance in Mac OS X

Feb 5, 2013 - 25 Comments

The standard terminal appearance is just boring old black text on a white background. Apple included a few nice preset themes too, but to really make your terminals appearance stand out you’ll want to take the time to customize it yourself. While some of these tweaks are admittedly pure eye candy, others genuinely improve the command line experience and make using the terminal not only more attractive but easier to scan.

Improve the Terminal appearance in Mac OS X

Follow along and try them all, or just pick and choose which makes the most sense for you.

Modify Bash Prompt, Enable Colors, Improve ‘ls’

At a bare minimum, let’s get a better bash prompt, improve the output of the frequently used ls command, and enable colors. This is all done by editing the .bash_profile or .bashrc located in the home directory, for the purpose of this walkthrough we’ll use .bash_profile:

  • Open Terminal and type nano .bash_profile
  • Paste in the following lines:
  • export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
    export CLICOLOR=1
    export LSCOLORS=ExFxBxDxCxegedabagacad
    alias ls='ls -GFh'

  • Hit Control+O to save, then Control+X to exit out of nano

The first line changes the bash prompt to be colorized, and rearranges the prompt to be “username@hostname:cwd $”

The next two lines enable command line colors, and define colors for the ‘ls’ command

Finally, we alias ls to include a few flags by default. -G colorizes output, -h makes sizes human readable, and -F throws a / after a directory, * after an executable, and a @ after a symlink, making it easier to quickly identify things in directory listings.

Pasted in properly, it should look like this:

Improve the Terminal appearance

Open a new terminal window, run ls, and see the difference. Still not satisfied with the appearance, or have you already done that? There’s more to do.

Enable Bold Fonts, ANSI Colors, & Bright Colors

This will be theme and profile dependent, meaning you will have to adjust this for each theme. Most themes have ANSI color on by default, but enable it if it’s not.

  • Pull down the Terminal menu and choose “Preferences”, then click the “Settings” tab
  • Choose your profile/theme from the left side list, then under the “Text” tab check the boxes for “Use bold fonts” and “Use bright colors for bold text”

Enable bold fonts and bright colors in Terminal

This makes things like directories and executables be bold and brighter, making them easier to spot in listings.

Adjust Background Opacity, Blur, & Background Image

After you have colorization squared away, adjusting the terminals background appearance is a nice touch:

  • Back in Terminal Preferences, choose the theme from the left side, then go to the “Window” tab
  • Click on “Color & Effects” to adjust the background color, opacity, and blur – opacity at 80% or so and blur at 100% is pleasant on the eyes
  • Click on “Image” to select a background picture. Dark background pictures are better for dark themes, light for light, etc

Adjust the Terminals background and appearance

Opacity and blur alone tend to be enough, but going the extra step to set a background picture can look either really nice or completely garish. You make the call.

Terminal window with background image in Mac OS X

Install a Theme

Another approach is to use Terminal themes like IR Black, which are simple to install, add custom colors, and make the command line much more attractive. Here are three popular themes:

You can also easily create your own by spending some time with Terminal Preferences and setting colors and fonts to what you like.

New Terminal vs Old Terminal

Put it all together, and you should have something like this:

Better looking terminal in Mac OS X

Which is a bit more interesting to look at than this, right?

Command prompt

Have a useful bash prompt or some other customization tip? Let us know in the comments.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: William Pearson in Command Line, Tips & Tricks

25 Comments

» Comments RSS Feed

  1. parakeet says:

    Text makes a big impact. I like Monaco as a font, anti-alias is a must, and use Command+ and Command- to change the font size on the fly depending on how much space you need.

    And don’t forget to use Full Screen Terminal if you really need to focus.

  2. John Robinson says:

    Control-X does not work in Mountain Line Terminal. Also using the arrow keys did not work in the terminal window.

  3. koraz says:

    Thanks, it’s indeed better than the default one. Colors is a must for terminal users. Thank you !

  4. Leo M. says:

    In addition, there’s a nice LSCOLORS generator if you’d like to tweak.. it’s probably one of many on the ‘net:

    http://geoff.greer.fm/lscolors/

    Just use the ‘BSD colors’ and you’re set

  5. John Robinson says:

    Control+X does not work in my Mountain Lion? Got any other suggestions.

  6. koraz says:

    @John
    What do you mean ? Because it does work in nano.

  7. Dan says:

    This is one of your own, from 3 October 2011, and a favorite of mine:

    “If you want to customize the Terminals appearance a bit beyond the prompt and a custom background, you can make the Terminal much more readable by using this nice trick to add a separator and timestamp between each executed command. This also bolds the current command text and anything that is available from tab completion.”

    http://osxdaily.com/2011/10/03/add-a-separator-time-stamp-between-terminal-commands-to-increase-readability/

  8. sudocvu says:

    Why not use iTerm2 and oh-my-zsh (https://github.com/robbyrussell/oh-my-zsh)

  9. Hoylen says:

    To change the colors in the PS1 prompt, change the text between the “\[033[" and the "m\]“. Nothing means reset to default; number means that color; number followed by “;1″ means the bright or bold version of that color.

    31 – red
    32 – green
    33 – yellow
    34 – blue
    35 – magenta
    36 – cyan
    37 – white

    For example, “\[33[34;1m\]” is bold/bright blue.

    The special values (e.g. \u for the username, \h for the hostname, \w for the current working directory) are documented in the “PROMPTING” section of the bash man page.

    Don’t like the actual colors displayed (e.g. blue is hard to read on a black background)? Change them in Terminal’s preferences (under Settings and the profile being used.)

  10. Maicon Nunes says:

    The best tip is get rid of Terminal.app and use iTerm2. Anyone who uses shell professionally will tell you the same.

    • Frizlab says:

      I use Terminal everyday professionally and wouldn’t switch to anything else for all the gold of the world…
      You may prefer iTerm2, but let others have their own opinion.

    • Andrew says:

      I also feel no need to try iTerm2 now that Terminal.app has tabs.

  11. jon says:

    Ever since I discovered the free Source Code Pro font, I’ve never used anything else for all my Terminal & plain text work.

    And the colors are pretty & convenient, but I prefer to go all green-on-black. Guess I’m just pining for my old Apple II+.

  12. Frizlab says:

    @Maicon Nunes
    I use Terminal everyday professionally and wouldn’t switch to anything else for all the gold of the world…
    You may prefer iTerm2, but let others have their own opinion.

  13. tito says:

    LOLO, do you really think the first screenshot is an improvement ? Or is the improvement visible after wearing sunglasses ?

  14. Daniel says:

    What exactly are the “command line colors” enabled by CLICOLOR?

  15. Andrew says:

    export HISTSIZE=5000
    export HISTFILESIZE=5000
    export HISTCONTROL=ignoredups
    export HISTTIMEFORMAT=’%F %T > ‘

    export GREP_COLOR=’1;32′

  16. Arpit says:

    How about switching to zsh? :)

  17. giuseppe says:

    how to revert to the original ?

  18. Andrew Rich says:

    Thanks for this article and useful comments! I put these into my ~/.profile – why would I use ~/.bash_profile instead?

    export PS1=”\[33[36m\]\u\[33[m\]@\[33[32m\]\h:\[33[33;1m\]\w\[33[m\]\$ ”
    export CLICOLOR=1
    export LSCOLORS=ExFxBxDxCxegedabagacad
    alias ls=ls\ -AFGhl
    export HISTIGNORE=”$HISTIGNORE:fortune:history”
    export HISTCONTROL=”ignoredups”
    export HISTTIMEFORMAT=”%F %T > ”
    export GREP_OPTIONS=”–color=auto”
    export GREP_COLOR=”1;32″

  19. Jinx says:

    I pasted in the color settings just as described in this article, and now every time I log in I see this:

    -bash: alias: -: not found
    -bash: alias: See: not found
    -bash: alias: more: not found
    -bash: alias: at:: not found
    -bash: alias: http://osxdaily.com/2013/02/05/improve-terminal-appearance-mac-os-x/#sthash.tKyckXI0.dpuf: not found

    Any ideas how I can get rid of this?

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates