Skip to content

Instantly share code, notes, and snippets.

@loisaidasam
Created July 16, 2018 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loisaidasam/f7b0577d7ab97c23f7981ea0d9516702 to your computer and use it in GitHub Desktop.
Save loisaidasam/f7b0577d7ab97c23f7981ea0d9516702 to your computer and use it in GitHub Desktop.
Bash $PS1 dynamic hostname fix
# Question:
# https://twitter.com/LoisaidaSam/status/1018897916293984256
# Answer:
# https://apple.stackexchange.com/questions/40734/why-is-my-host-name-wrong-at-the-terminal-prompt-when-connected-to-a-public-wifi/127405#127405
:) Michaels-iPhone:~$ scutil --get HostName
HostName: not set
:( 1 Michaels-iPhone:~$ sudo scutil --set HostName 'chewbacca'
Password:
:) Michaels-iPhone:~$ scutil --get HostName
chewbacca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment