Characters do not echo in OS X terminal unless I hit the delete key

Your prompt is messed up, specifically PS1:

PS1=$[\033]0;37m]

that's missing a lot of escape characters (\e[) needed for the colors (and most useful parameters for a PS1). That's also why you get the 37m in the terminal window title. Try setting it to something different by running:

export PS1="\e[0;31m[\h:\W \u]\$\e[m "

and see if that works. It should give a red (thats \e[0;31m) prompt showing hostname (\h), current working directory (\W) and logged in user (\u) inside brackets [] and the bash exit status of the previous command (\$). Note that at the end the color is reset to the default of the session with \e[m .

If the above worked, you only have to find out from which configuration file your "bad" PS1 comes from: look for an "export PS1=" line in ~/.profile, ~/.bash_profile, ~/.bashrc, (as M K already suggested in his answer) and put in the above version.

There are a lot of answers around here with helpful colors codes and inputs for configuring the PS1, like this one for example.


Firstly, look at Terminal preferences (Cmd+,)for the font, text and color settings and change them appropriately. This may not be the issue, but it could make troubleshooting easier.

It may be the case that you have some profile script that changes the colors. Within Terminal.app, type the following command to start bash on a clean slate (without executing any profile scripts):

bash --noprofile --norc

If you no longer face the text visibility issue, then check all the profile scripts (some may not be present) like /etc/profile, ~/.profile, ~/.bash_profile, ~/.bashrc, look for any ANSI escape sequences and remove those.