Heroku Changed My .bash_profile

I recently installed the Heroku toolbelt and was surprised to see my bash settings changed the next time I opened a terminal window. Three hash marks had been added to my command line prompt without permission! (I’m guessing because Heroku changes PATH in .bash_profile they just added a comment to the line before it, without considering users who have customized their settings and already have something defined on that line.)

But it’s not a big deal. Here’s how I fixed it:

(1) Open a terminal window

(2) Enter cd to go to your home directory

(3) Use your editor of choice to open .bash_profile. If you like vim, the command is vi .bash_profile

(4) Remove the offending “### Added by Heroku Toolbelt” comment. (You may find these vim commands useful.)

(5) Save and exit. The vi command is ZZ (Shift+Z Shift+Z).

(6) Close and reopen your terminal window.

If you cd into your home directory and enter cat .bash_profile you should see your restored bash settings

In the examples above you’ll see some of my customized bash settings that probably differ from yours. If you’d like more information about customizing your terminal command prompts, there are several tutorials online.

Written on January 15, 2015