ZSH: Hide computer name in terminal
On MacOS 10.15 Catalina:
- Open the file
/private/etc/zshrc
in a text editor - Locate the comment:
# Default prompt
- Modify the line that looks like this:
PS1="%n@%m~ %& # "
- Save the file. You will be prompted to enter a password to save it.
- Load a new Terminal window.
For example, you can:
- Remove
"%n@%m"
to get rid of both the username and computer name - Remove
"%n"
to get rid of the user name - Remove
"%m"
to get rid of the machine name
Try to add export DEFAULT_USER=$USER
to your .zshrc
file