__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD

Actually no idea. You don't even have the $HOST in PS1 (if what you wrote is correct). Try logging out, and in again.

__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD

You don't even have the $HOST in PS1 (if what you wrote is correct). Try logging out, and in again.

I tried logging out and logging in - it doesn't help.

You are right, I don't have the $HOST in PS1 because $HOST has been set by default. The reason? I think, it's because I have the following entry in my /etc/rc.conf:

Quote:

hostname=sushi.my.domain

This is because afterboot (8) says:

Quote:

Check hostname
Use the hostname command to verify that the name of your machine is cor-
rect. See the man page for hostname(1) if it needs to be changed. You
will also need to change the contents of the ``hostname'' variable in
/etc/rc.conf or edit the /etc/myname file to have it stick around for the
next reboot.

Are you saying that since you put that entry in rc.conf the prompt has started showing hostname in it?
Setting hostname in rc.conf should have nothing to do with setting PS1 prompt. Check your .profile, .kshrc or similar for any entry that you might have forgot, concerning PS1.

__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD

Setting hostname in rc.conf should have nothing to do with setting PS1 prompt.

Well, in this case it does! I just made the experiment and deleted "hostname=sushi.my.domain" from /etc/rc.conf. As a result, postfix complained about the now missing hostname on the reboot and the prompt changed from "sushi$" to "$" (with and without Xorg running).

I was facing the same issue here, where my hostname was getting arbitrarily inserted into the prompt.

The issue, i found out was the ".shrc" file in the home directory. This file pulls in another file "/etc/shrc". If you have a look at "/etc/shrc", you'll find it performs a lot of tomfoolery with PS1 (including inserting the hostname), editor keybindings, etc.

I didn't find anything useful being done by these scripts, so i renamed ".shrc" to ".shrc_old". That gave me back the prompt i wanted (without the hostname), and as a bonus my keybindings of the editor to vi also got picked up instead of being ignored.