From 2fce9a4d44f822c03ce874268338961d0761f1a9 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 17 Oct 2018 20:53:07 +0200 Subject: agnoster: use %n instead of $USER to fix quoting Fixes #7268 With `$USER`, we'd need to quote it in case special characters like `\` are present in the $USER value, like if the user is part of an AD domain. With `%n` the quoting is done automatically by zsh. See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Login-information --- themes/agnoster.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 1ac3fc96b..0edb773aa 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -89,7 +89,7 @@ prompt_end() { # Context: user@hostname (who am I and where am I) prompt_context() { if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then - prompt_segment black default "%(!.%{%F{yellow}%}.)$USER@%m" + prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m" fi } -- cgit v1.2.3-70-g09d2 From f96d18ca935f9b9bd6f1c51cb5c821a0b18e9601 Mon Sep 17 00:00:00 2001 From: Ezequiel Pochiero Date: Sat, 27 Oct 2018 12:09:55 -0300 Subject: avit: fix handling of time since last commit (#7350) --- themes/avit.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme index cf439f757..aec14e4a6 100644 --- a/themes/avit.zsh-theme +++ b/themes/avit.zsh-theme @@ -63,7 +63,7 @@ function _git_time_since_commit() { sub_hours=$((hours % 24)) sub_minutes=$((minutes % 60)) - if [ $hours -gt 24 ]; then + if [ $hours -ge 24 ]; then commit_age="${days}d" elif [ $minutes -gt 60 ]; then commit_age="${sub_hours}h${sub_minutes}m" -- cgit v1.2.3-70-g09d2 From e0ee79f2bc985456f302349457fdf30587fb2dad Mon Sep 17 00:00:00 2001 From: Aurélien Bourdon Date: Mon, 31 Dec 2018 20:12:55 +0100 Subject: Remove duplicate space on the maran theme (#7454) --- themes/maran.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/maran.zsh-theme b/themes/maran.zsh-theme index 6fba04688..fddb7bc30 100644 --- a/themes/maran.zsh-theme +++ b/themes/maran.zsh-theme @@ -1,6 +1,6 @@ # Theme with full path names and hostname # Handy if you work on different servers all the time; -PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%} $(git_prompt_info) %(!.#.$) ' +PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%}$(git_prompt_info) %(!.#.$) ' ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}git:(" ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From 851899e59ea71ce8fbae738ec7aeb7a967585977 Mon Sep 17 00:00:00 2001 From: Brian Hong Date: Thu, 31 Jan 2019 08:57:37 -0500 Subject: theme/gallifrey: set color to red if root (#6203) --- themes/gallifrey.zsh-theme | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'themes') diff --git a/themes/gallifrey.zsh-theme b/themes/gallifrey.zsh-theme index 252566f06..768547064 100644 --- a/themes/gallifrey.zsh-theme +++ b/themes/gallifrey.zsh-theme @@ -1,8 +1,11 @@ -# ZSH Theme - Preview: https://flic.kr/p/ZFvivf -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" +# ZSH Theme - Preview: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#gallifrey +return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" +host_color="%(!.%{$fg[red]%}.%{$fg[green]%})" -PROMPT='%{$fg[green]%}%m%{$reset_color%} %2~ $(git_prompt_info)%{$reset_color%}%B»%b ' +PROMPT="${host_color}%m%{$reset_color%} %2~ \$(git_prompt_info)%{$reset_color%}%B»%b " RPS1="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" + +unset return_code host_color -- cgit v1.2.3-70-g09d2