I admit it. I like pretty colors. When I see other devs in their pretty terminals, I get a bit jealous. For that reason, I installed iTerm 2 so I could use the color profiles. But none of the profiles seemed to do anything worthwhile. They never looked anything like the demos. All they seemed to do was change the base text color and terminal background. I wanted something that would at least show different colors for files and directories.
After going around in circles for a while, I came across this Stack Overflow post that suggested I had to edit my .bash_profile
.
.bash_profile
All the Things!
Then I thought, why stop there? I figured now was the time to get familiar with adding aliases for Git and other repetitive things that I type all the time. I came across some great articles, such as this one from OSXDaily. However, what I ended up swiping came from a .bash_profile
I found on Github.
However, when I saved my .bash_profile
and tried to run steroids connect
to start development on a mobile app, I got an bash error saying that the steroids
command could not be found.
Then I remembered that there seemed to be some issue with using .bash_profile
vs .profile
. I am far from a bash expert, but I seem to recall that changed at some version of OSX. I figured since my environment already had a .profile
, I would just put the configuration in there. Once I did that, my commands worked as expected, and I magically had the color scheme I desired in iTerm 2.
.profile
Script
I didn’t end up using that script exactly. Here is what I have in my .profile
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
export CLICOLOR=1 export LSCOLORS=GxFxCxDxBxegedabagaced alias ls='ls -GFh' function prompt { local BLACK="\[\033[0;30m\]" local BLACKBOLD="\[\033[1;30m\]" local RED="\[\033[0;31m\]" local REDBOLD="\[\033[1;31m\]" local GREEN="\[\033[0;32m\]" local GREENBOLD="\[\033[1;32m\]" local YELLOW="\[\033[0;33m\]" local YELLOWBOLD="\[\033[1;33m\]" local BLUE="\[\033[0;34m\]" local BLUEBOLD="\[\033[1;34m\]" local PURPLE="\[\033[0;35m\]" local PURPLEBOLD="\[\033[1;35m\]" local CYAN="\[\033[0;36m\]" local CYANBOLD="\[\033[1;36m\]" local WHITE="\[\033[0;37m\]" local WHITEBOLD="\[\033[1;37m\]" local RESETCOLOR="\[\e[00m\]" export PS1="\n$RED\u $PURPLE@ $GREEN\w\n $BLUE[\#] → $RESETCOLOR" export PS2="| → $RESETCOLOR" } prompt |
Chalk Color Scheme
And here is what my prompt looks like with the chalk iTerm 2 profile color scheme: