title: Command Line - PS1 Settings causing unexplainable behavior
body: <p>Good morning,</p>
  
  <p>Something strange is going on with my command line and I need a little assistance figuring out what the problem is.</p>
  
  <p>First I have been using my Mac Book to write code for over a year and when I started I was using tools provided by The Flatiron School. I mention this because I don't know how this <code>.bash_profile</code> file was created in my home directory and I suspect it was created when I set up my machine with their "assistance". I think I am dealing with some version of Git Bash but I'm not sure- I was blindly following this bootcamp's instructions.</p>
  
  <p>Recently I changed a local variable <code>CHAR</code> in my <code>.bash_profile</code> that is a part of my PS1 settings. Changing my prompt from <code>//❤️</code> (default) to <code>⚡️  ⚡️</code> (much cooler).</p>
  
  <p>I read up on the PS1 setting in order to change my command line prompt and believe to have done everything right but two really annoying behaviors have arisen: </p>
  
  <p>1) When I delete all my terminal input my prompt is deleted as well but returns after hitting enter like this: (going to have to take my word for it)
  <a href="https://i.stack.imgur.com/RyArE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RyArE.png" alt="Issue #1 deleting prompt"></a></p>
  
  <p>2) When my terminal input reaches the edge of the window it forms a new line of 5 characters then forms a new line again like so: </p>
  
  <p><a href="https://i.stack.imgur.com/svFer.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/svFer.png" alt="Issue #2 skipping a line, 5 characters, and a new line "></a></p>
  
  <p>Finally here is what I believe to be the relevant code in my <code>.bash_profile</code> file, my hope is that someone with more experience in the command line and PS1 will be able to see what I'm doing incorrectly, thanks for reading.</p>
  
  <pre><code>   # This function builds your prompt. It is called below
    function prompt {
      # Define some local colors
      local         RED="\[\033[0;31m\]" # This syntax is some weird bash color thing I never
      local   LIGHT_RED="\[\033[1;31m\]" # really understood
      local        CHAR="\[⚡️  ⚡️\]"
      local   BLUE="\[\e[0;49;34m\]"
  
      # ♥ ☆ - Keeping some cool ASCII Characters for reference
  
      # Here is where we actually export the PS1 Variable which stores the text for your prompt
  
      export PS1="\[\e]2;\u@\h\a[\[\e[37;44;1m\]\t\[\e[0m\]]$RED\$(parse_git_branch) \[\e[32m\]\W\[\e[0m\]\n\[\e[0;31m\]$CHAR \[\e[0m\]"
        PS2='&gt; '
        PS4='+ '
      }
  
    # Finally call the function and our prompt is all pretty
    prompt
  </code></pre>