From 74177c5320b2a1b2f8c4c695c05984b57fd7c6ea Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 9 Oct 2014 13:44:54 +0200 Subject: Change all whoami calls for $USER variable This avoid spawning additional processes, as the $USER variable will **always** contain the current logged-in user. --- themes/adben.zsh-theme | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'themes/adben.zsh-theme') diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme index aa3093f64..6869c8a20 100644 --- a/themes/adben.zsh-theme +++ b/themes/adben.zsh-theme @@ -89,9 +89,8 @@ function precmd { # Context: user@directory or just directory prompt_context () { - local user=`whoami` - if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then - echo -n "${PR_RESET}${PR_RED}$user@%m${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}" + if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then + echo -n "${PR_RESET}${PR_RED}$USER@%m${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}" else echo -n "${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}" fi -- cgit v1.2.3-70-g09d2