summaryrefslogtreecommitdiff
path: root/themes/adben.zsh-theme
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2014-10-09 13:44:54 +0200
committerMarc Cornellà <marc.cornella@live.com>2014-11-06 18:33:56 +0100
commit74177c5320b2a1b2f8c4c695c05984b57fd7c6ea (patch)
tree25e9bac6d2b14229ae5d5645d1a4344795233f81 /themes/adben.zsh-theme
parent7034b01cd10cebb2658f54aa07ac0ce5ee64e0e0 (diff)
downloadzsh-74177c5320b2a1b2f8c4c695c05984b57fd7c6ea.tar.gz
zsh-74177c5320b2a1b2f8c4c695c05984b57fd7c6ea.tar.bz2
zsh-74177c5320b2a1b2f8c4c695c05984b57fd7c6ea.zip
Change all whoami calls for $USER variable
This avoid spawning additional processes, as the $USER variable will **always** contain the current logged-in user.
Diffstat (limited to 'themes/adben.zsh-theme')
-rw-r--r--themes/adben.zsh-theme5
1 files changed, 2 insertions, 3 deletions
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