Something wrong with my terminal prompt...

colddiver

Registered
I remember seeing a post about that same problem but I coudn't remember where and search didn't produce any results so here it is:

For some reason, my terminal prompt is no longer displaying user name. All I have now is:

localhost%

What's wrong and how can I fix this?

Thanks

Colddiver
 
I reboted in single user and ran fsck... It found some problems and repaired them. Everything is back to normal now.

Still would be interesting to know what caused this...

Colddiver
 
hows that for a title...

apparently some combination of either not finding tcsh or not finding the normal init files for your shell would cause that.

basically, your shell parameters are initialized by files in /usr/share/init/tcsh

and then possibly customized by files which you can create in
~/Library/init/tcsh

if something were to go wrong....

some or none of those files might be unread and you would have an unitiialized shell. Mostly evidenced by failing to run the propmpt configuration commands in this case.

you may have also found that no path variables were set and you couldn't run commands normally either.

Have a look at your console.log file as there may be some [blah....] file not found at exactly the time when you were having the problem.
 
You can customize your terminal prompt in all kinds of fun ways. If you make a file named .tcshrc in your user directory then you can augment and override the /usr/share/init/tcsh/ items.

I like having a big old line dividing my commands so I can follow things more easily as I page-up and down. So in my .tcshrc file I set my prompt like so:

set prompt="______________________________________________________________\n[%m:%c3] %n%# "


.tcshrc is a good place to add access paths for command-line-oriented software you've installed in some weird place. I use MySQL and have it installed in a nice safe area away from the rest of the filesystem. My extra access path command looks like this:

setenv PATH ${PATH}:/usr/local/mysql/bin

I also have fortune installed. Every time I open a new terminal window I get a new random fortune. Very fun. All I have to do is run it inside the .tcshrc file:

/usr/local/bin/fortune
 
Back
Top