I started to see an extra bracket on my Mac Terminal

I thought it is because of my .bash_profile that I might have broke when I modified it.

But NO. I comment the whole file out and I still see that

[ - at the beginning of my prompt

] - at the end of my prompt

enter image description here


How would one go about and debug this ?

I'm opening to any suggestions at this moment.

Any hints / suggestions / helps on this be will be much appreciated !

  • 1
    and you didn't think to show us your $PS1 variable? – glenn jackman Nov 8 '16 at 20:23
  • I commented out my entire .bash_profile , I'm not sure how to show it to you. Should I include my commented out .bash_profile ? Do you think it is necessary ? – cyber8200 Nov 8 '16 at 20:25
  • You can show us with echo "${PS1}" or optionally with literal double-quotes: `echo "\"${PS1}\"" – bgStack15 Nov 9 '16 at 14:49
  • If I comment out my .bash_profile, Run echo "${PS1}" return \h:\W \u\$ – cyber8200 Nov 9 '16 at 15:05
  • If I don't comment out my .bash_profile, Run echo "${PS1}" return ──\[\033[1;37m\][\[\033[0;32m\]\w\[\033[1;37m\]]\n└── \[\033[1;37m\] – cyber8200 Nov 9 '16 at 15:07

I think you mean the marks on the outside of the terminal. Shown here:

enter image description here

That bracket is a feature of Terminal, and not realated to your prompt. The solution is to Hide Marks, go to View -> Hide Marks and they will no longer appear.

enter image description here

| improve this answer | |

What extra character? If you mean the tilde "~" then that is just an indication that you are somewhere in you home directory tree. Tilde is the standard *nix abbreviation for your "home" directory.

| improve this answer | |
  • I highlight it with a red box in my picture in my post. It's not ~. It's [ and ] – cyber8200 Nov 9 '16 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.