3

As the title states, when I open up terminal to type a command, I cannot see what I am typing, it is as if the terminal is frozen. I can still execute commands when I hit return, I just cannot see what I am typing.

The weird part is that when I hit the delete key, I am suddenly able to see what I am typing, and the terminal functions normally until I run the command.

As well, when I hit delete the header at the top of the terminal window changes from:

name - bash - 80x24

to:

name - 37m - bash - 80x24

Any help would be greatly appreciated. Thank you

edit: Thanks for all the help, I've tried some of the suggestions. Creating a new Admin account and opening terminal seemed to do the trick; I can type in terminal in this new account without pressing delete. Any ideas for my main account?

Here is what I get when I run: /usr/bin/env

$/usr/bin/env
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/h5/rp872k9n0zq2lkl0kbbykjx00000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-KfwCn3/Render
TERM_PROGRAM_VERSION=326
TERM_SESSION_ID=F81718AA-A3FC-4FB9-9FF4-00037406DBAF
USER=derekbogdanoff
SSH_AUTH_SOCK=/tmp/launch-qQfC1a/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
__CHECKFIX1436934=1
PWD=/Users/derekbogdanoff
LANG=en_CA.UTF-8
PS1=$[\033]0;37m]
SHLVL=1
HOME=/Users/derekbogdanoff
LOGNAME=derekbogdanoff
_=/usr/bin/env

  • 1
    1) update your post with the output of the command (typed directly) /usr/bin/env 2) Do you have a ~/.profile, ~/.bashrc, or ~/.bash_profile in your home directory? 3) Please test this behavior in another user account and report back. Create a new administrative account in System Preferences > Users & Groups and see if the same behavior occurs. – njboot Jun 19 '14 at 5:06
2

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.

  • 1
    This worked! I'm a bit new at this, so thanks for your help – user3749625 Jun 19 '14 at 21:42
1

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.

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.