about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.config/zsh/.zshrc7
1 files changed, 6 insertions, 1 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
index 79cd4c9..2e73a3a 100644
--- a/.config/zsh/.zshrc
+++ b/.config/zsh/.zshrc
@@ -86,10 +86,15 @@ function spacetotab () {
 # TODO git integration was useful - port something from belak/zsh-utils or ohmyzsh
 # TODO location should control its length a little better
 # TODO only color the last segment of the path (pwd)
+user="%n"
+if [[ -n "$SSH_CLIENT" || "$USER" == "root" ]]; then
+	user+="@%M"
+fi
 last_status="%(?.%F{green}%#.%F{red}%?)%f"
 location="%F{blue}%3~%f"
-PROMPT="[%n@%m:$location] $last_status "
+PROMPT="[$user:$location] $last_status "
 RPROMPT="%!"
+unset user
 unset last_status
 unset location