zshprompt

ZSH: Hide computer name in terminal


How would I hide the computer name in the prompt while using the terminal?

At the moment it shows both username and computer name like so:

iTerm screenshot of user prompt

It would save some space by removing anwarchoukah@anwars-mbp, seeing as I actually know who I am:)


Solution

  • Open up .zshrc, find the line reading export PS1 or maybe export PROMPT.

    Remove the variable that is used for the hostname, could be %m or %M.

    Zsh on Archlinux wiki

    You can use colors and also have a prompt (or some information) on the right side.