Terminal: how to fix computer name

In Terminal, my <name>@<computer name> should be:


<name>@MyMac, and the prompt should look like:

<name>@MyMac ~%


somehow, my computer name acquired an addition:


<name>@MyMac-WiFi, and the prompt now looks like:

<name>@MyMac-WiFi ~ %


For the life of me, I cannot remember what I did to add the "-WiFi", and can't find a way to fix it. I'm sure it's so simple that I don't see it.


Advice? Thank you - Andy


iMac 27″ 5K, macOS 13.6

Posted on Aug 19, 2024 08:45 PM

Reply
Question marked as Top-ranking reply

Posted on Aug 19, 2024 09:55 PM

In System Settings>Network>Sharing... scrol to bottom>Local Hostname>Edit... rename the part before .local

Similar questions

9 replies

Aug 20, 2024 08:45 AM in response to alaz0

Ah, good work finding it, sorry.


Are you logged into another device?


Are you running any VPN?


Thanks to MrHoffman, lets see if this helps nrrow it down...


scutil —-get ComputerName # the ”friendly” name

scutil —-get LocalHostName # the Bonjour / mDNS / ZeroConf host name

scutil —-get HostName # should be the same as what hostname command returns


Oh, just checking,have you quit & restarted Terminal?

Aug 20, 2024 12:34 PM in response to alaz0

Based on your feedback, and my dealing with an older OS (yeah, I know.... it's coming), I thought MacOS might be turning on the "-WiFi" part when WiFi is turned on (I have both Wired and WiFi turned on, per Apple instructions). I turned off my WiFi, and the Terminal ID showed my network without the "-WiFi"; when I turned WiFi back on, the "-WiFi" came back in terminal. It's clear that Terminal has a sensor for WiFi and chooses to broadcast it on every prompt. I'm using the basic Terminal in /etc/zshrc.


Not on VPN, standard Internet connection via Spectrum cable, not logged in elsewhere. But that was helpful in narrowing the possibilities.


Thank you for your help! You provided the missing link to find the problem.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Terminal: how to fix computer name

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.