Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 4
    Be sure to add your code to PROMPT_COMMAND rather than replacing it, e.g., PROMPT_COMMAND="<your code>; $PROMPT_COMMAND"; otherwise, you’ll disable other functionality that uses this variable. For example, /etc/bashrc uses it to set the terminal’s current working directory so Terminal can display it and use it for various operations. Commented Oct 25, 2014 at 0:06
  • @ChrisPage Does the new code need to come before $PROMPT_COMMAND for the other functionality to be preserved? Commented Oct 25, 2015 at 3:45
  • Why not put it directly into PS1? Commented Aug 2, 2016 at 9:22
  • is this how you edit the .bash_profile? sublime $HOME/.bash_profile ? Commented Nov 23, 2016 at 0:42
  • @Awesome_girl Make sure that the subl command is installed, and then edit the file from your terminal using subl ~/.bash_profile. If this command doesn't exist, follow this: sublimetext.com/docs/2/osx_command_line.html Commented Nov 27, 2016 at 18:30