summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2021-03-25 12:08:00 +0100
committerMarc Cornellà <hello@mcornella.com>2021-03-25 12:08:00 +0100
commit02d07f3e3dba0d50b1d907a8062bbaca18f88478 (patch)
treecbac73b3b000eb85971f0f37ab2dfea3334cd05d /themes
parent95a06f3927a286db257dc99791b02caba757fe33 (diff)
downloadzsh-02d07f3e3dba0d50b1d907a8062bbaca18f88478.tar.gz
zsh-02d07f3e3dba0d50b1d907a8062bbaca18f88478.tar.bz2
zsh-02d07f3e3dba0d50b1d907a8062bbaca18f88478.zip
fix: use `$USERNAME` guaranteed to always be defined in zsh
Fixes #9701
Diffstat (limited to 'themes')
-rw-r--r--themes/adben.zsh-theme4
-rw-r--r--themes/agnoster.zsh-theme2
-rw-r--r--themes/avit.zsh-theme2
-rw-r--r--themes/flazz.zsh-theme2
-rw-r--r--themes/obraun.zsh-theme2
-rw-r--r--themes/re5et.zsh-theme2
-rw-r--r--themes/sunrise.zsh-theme2
7 files changed, 8 insertions, 8 deletions
diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme
index b9ac77d00..7321df724 100644
--- a/themes/adben.zsh-theme
+++ b/themes/adben.zsh-theme
@@ -89,8 +89,8 @@ function precmd {
# Context: user@directory or just directory
prompt_context () {
- if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
- echo -n "${PR_RESET}${PR_RED}$USER@%m${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}"
+ if [[ "$USERNAME" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
+ echo -n "${PR_RESET}${PR_RED}$USERNAME@%m${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}"
else
echo -n "${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}"
fi
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index 99707f684..fe7ddbac6 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -88,7 +88,7 @@ prompt_end() {
# Context: user@hostname (who am I and where am I)
prompt_context() {
- if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
+ if [[ "$USERNAME" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m"
fi
}
diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
index 921ed99d3..1e20d8f9f 100644
--- a/themes/avit.zsh-theme
+++ b/themes/avit.zsh-theme
@@ -17,7 +17,7 @@ function _user_host() {
local me
if [[ -n $SSH_CONNECTION ]]; then
me="%n@%m"
- elif [[ $LOGNAME != $USER ]]; then
+ elif [[ $LOGNAME != $USERNAME ]]; then
me="%n"
fi
if [[ -n $me ]]; then
diff --git a/themes/flazz.zsh-theme b/themes/flazz.zsh-theme
index c0a7fb5d0..e21b52ef5 100644
--- a/themes/flazz.zsh-theme
+++ b/themes/flazz.zsh-theme
@@ -1,4 +1,4 @@
-if [ "$USER" = "root" ]
+if [ "$USERNAME" = "root" ]
then CARETCOLOR="red"
else CARETCOLOR="blue"
fi
diff --git a/themes/obraun.zsh-theme b/themes/obraun.zsh-theme
index 7af44056f..cc2769e4b 100644
--- a/themes/obraun.zsh-theme
+++ b/themes/obraun.zsh-theme
@@ -1,4 +1,4 @@
-if [ "$USER" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
+if [ "$USERNAME" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
diff --git a/themes/re5et.zsh-theme b/themes/re5et.zsh-theme
index 95af1e2ee..bdf342f49 100644
--- a/themes/re5et.zsh-theme
+++ b/themes/re5et.zsh-theme
@@ -1,4 +1,4 @@
-if [ "$USER" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="magenta"; fi
+if [ "$USERNAME" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="magenta"; fi
local return_code="%(?..%{$fg_bold[red]%}:( %?%{$reset_color%})"
diff --git a/themes/sunrise.zsh-theme b/themes/sunrise.zsh-theme
index 2111576c3..11f6af127 100644
--- a/themes/sunrise.zsh-theme
+++ b/themes/sunrise.zsh-theme
@@ -9,7 +9,7 @@ Y=$fg_no_bold[yellow]
B=$fg_no_bold[blue]
RESET=$reset_color
-if [ "$USER" = "root" ]; then
+if [ "$USERNAME" = "root" ]; then
PROMPTCOLOR="%{$R%}" PROMPTPREFIX="-!-";
else
PROMPTCOLOR="" PROMPTPREFIX="---";