Restoring terminal default prompt
MacBook Pro with Retina display, OS X El Capitan (10.11.3), null
MacBook Pro with Retina display, OS X El Capitan (10.11.3), null
gsaia wrote:
OK... I fixed it. For some reason I renamed the profile file to profile.old sometime ago. I must have been following some directions to do something.
I restored the profile file and now I get the right prompt.
Thanks.
You renamed .profile to profile.old for some reason. So you should "Review" the contents of your .profile to make sure there is not something that is going to cause other problems.
by default a new account does NOT have a shell initialization file. The 'bash' shell will look for
.bash_profile
.bash_login
.profile
in that order, and it will stop looking if it finds one and executes it. But like I said, none of these exist when you initially get your Mac unless you create one, or something you installed creates one. And something you installed is generally not a typical GUI app, but more likely an open source package that is intended to run on the terminal or an X11 based window.
If are not sure what you are looking at in the .profile, you can post it here in a reply and someone will try to tell you want it is doing, and if you want to keep everything in it. Or at least ask semi-intelligent questions about what is in it.
You can reset only your PS1 prompt in the current Terminal session with:
$ source /etc/bashrc
Use the PS1 line parameters from the above file in your own ~/.bashrc, or ~/.bash_profile files for PS1 permanence.
export PS1='\[\h:\W \u \$ '
The following terminal prompt appears where the local Mac hostname is mycomputer, base name of the working directory, and user is scrat:
mycomputer: ~ scrat $ echo $PS1
Thank you for your answer. @Jay-Ray: This was the first thing I tried but it does not work. I must have changed something somewhere else.
OK... I fixed it. For some reason I renamed the profile file to profile.old sometime ago. I must have been following some directions to do something.
I restored the profile file and now I get the right prompt.
Thanks.
Restoring terminal default prompt