I am unsure of when this problem began, which has made it hard diagnose, but I have very strange and incorrect characters in my terminal prompt. I will not give the exact characters, but it involves punctuation/special characters:


I'm very confused at why this might be. I'm using bash in High Sierra, but I believe this problem may have persisted over an upgrade.

Output of echo $PS1 is

  • 2
    We will need to see the prompt to help diagnose. Please edit your question with a screen grab and\or paste of the prompt. Also, please let us know what shell you are using as well as the version of macOS.
    – Allan
    Commented Jan 9, 2023 at 0:34
  • I'm concerned about security if I present the exact results, but I have attempted to explain in more detail. Commented Jan 9, 2023 at 2:38
  • Type he command echo $PS1 and paste the output to the question
    – Allan
    Commented Jan 9, 2023 at 2:41
  • Thank you Allan, you suggested the solution with this. Commented Jan 9, 2023 at 2:51

1 Answer 1


It was a mistake in ~/.bash_profile that I must have made when trying to configure colour differences in bash:

PS1=`\[\e[1;32m\][\u@\h \W]\$\[\e[0m\]`

This uses back-ticks instead of apostrophes. I commented out the lines pertaining to bash prompt and the problem is solved.

  • 3
    The string should be in single-quotes ('), not commas (,) or backticks. Also, it needs to be plain ASCII single-quotes, not the fancy unicode curly quotes (like , , or ). Commented Jan 9, 2023 at 3:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .