ZSH Agnoster Theme showing machine name

Drew picture Drew · Feb 13, 2015 · Viewed 36.8k times · Source

I have a development server hosted on Digital Ocean, using Ubuntu 14.04. I switched my shell to ZSH and decided to go with the Agnoster theme. In order to get user@hostname to stop showing, I set the DEFAULT_USER in my .zshrc file.

For some reason on the ubuntu server, that's not working. The hostname still shows, and will not go away. I'm doing the exact same thing on my Mac OSX, and it works fine.

Here are some screenshots:

enter image description here

enter image description here

Anyone know what's going on? I even tried DEFAULT_USER="$USER@$HOST" with no luck.

If I go back to the default, Robby Russell theme, it works just fine.

enter image description here

Answer

hchbaw picture hchbaw · Feb 13, 2015

It is the feature according to this; when we are sshing, the hostname will be shown.

Overriding the function prompt_context or build_prompt on Agnoster theme will rescue. Putting below snippets at the very end of the ~/.zshrc for example.

# redefine prompt_context for hiding user@hostname
prompt_context () { }