Terminal-App: What’s in front of colon and why does it change with a different network?
The string you see at the beginning of every line of Terminal is not a function of the Terminal application but a feature of any shell on any Unix system.
This string is defined as PS1 = Prompt String n°1.
On most shell this string is defined as containing your hostname as you can get it with the basic command hostname.
Of course, your hostname depend on your method of connection, your ISP, and how your computer name can be established from your DNS servers (Domain Name System).
When your computer doesn't have a connection established to the Internet, this name is its local name as you have defined it in System Preferences &gt; Sharing &gt; Computer Name:.
The last component of the line showing you how you connected
the last time you did is the terminal from which you were
connected on your Mac. Each shell session has a virtual terminal on which your shell commands are runs. This is the final part of the terminal name you were using as shown with the command tty.
If the Last login: information looks right to you, then it means your computer wasn't pirated and used by
a criminal.