I'm running into an issue with hiding my computer name. I want all terminal outputs on my mac (iTerm ->zsh & IntelliJ) to stop showing my computer name and show ~/. Can someone help me achieve this, I'm not sure what setting I'm looking to change.
ie.
From
users/ComputerName/app/src/main/java/com/virtualprodigy/android_compose_template
To
~/app/src/main/java/com/virtualprodigy/android_compose_template
Prompt format in zsh is controlled by
PROMPTorPS1variable. You can check if one of these variables is set up in~/.zshrc(if there's no such file, create it by runningtouch ~/.zshrc).If in your .zshrc you see a line setting either
PROMPTorPS1, in its value substitute%/(absolute path) with%~(relative to home path).If there's no such line in your .zshrc, you can just add this:
Then save the file and restart your terminal.