1

In macOS (Sonoma 14.6) my shell sometimes shows odd and long numbers inside the prompt instead of my host name for my Mac :

several command line prompts

Changing either the shell from zsh to bash (chsh -s /bin/...) and opening a new shell window - or (not sure about it yet) changing the profile in the settings suddenly I do have the normal shell prompt again. Oddly enough macOS Terminal shows these long numbers while Zoc.app - at the same time and same conditions - doesn't show them at all.

And something else is weird - might not have sth to do with the phenomenon in Terminal - in Apple Mail I do have sometimes these long numbers too, doesn't matter which Mail account.

Actually I am using a VPN connection (Cyberghost VPN - set up in Network settings), as well I am using Adguard app - which I suspect at the moment, but I don't know where to start.

How can I pin down why my host name is changing unexpectedly?

--

See as well the attached screenshots below -

mail header 1

mail header 2

1
  • 1
    The shell prompts are almost certainly your PS1 variable getting a host name from your router (or network stack). Can you clarify when in time this changes? Is it hours apart or new shells open ended within minutes of another?
    – bmike
    Commented Nov 24 at 1:05

1 Answer 1

1

Next time this happens, explicitly set your host name and verify your command line prompt is fixed.

 sudo scutil --set HostName "newname"

If so, check any of the 40+ questions linked from this one thread on how much confusion this behavior can generate. The mail situation might need more details once you sort your VPN and router giving your Mac a name you don’t expect when it requests an DHCP address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .