From 150a3c9c834d824bdea5c8755963790e3c8efded Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 24 Sep 2018 08:11:57 -0400 Subject: agnoster: respect git config oh-my-zsh.hide-status (#6362) --- themes/agnoster.zsh-theme | 3 +++ 1 file changed, 3 insertions(+) (limited to 'themes/agnoster.zsh-theme') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index d1a69c560..302de6e6f 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -96,6 +96,9 @@ prompt_context() { # Git: branch/detached head, dirty status prompt_git() { (( $+commands[git] )) || return + if [[ "$(git config --get oh-my-zsh.hide-status 2>/dev/null)" = 1 ]]; then + return + fi local PL_BRANCH_CHAR () { local LC_ALL="" LC_CTYPE="en_US.UTF-8" -- cgit v1.2.3-70-g09d2 From afa8dc46ecb1babda7db8fb8228224e8975e95f4 Mon Sep 17 00:00:00 2001 From: Carlo Dapor Date: Tue, 25 Sep 2018 21:46:27 +0200 Subject: Fix agnoster initial diagnostic error This PR fixes the runtime error that displays this: ```log prompt_status:2: symbols: attempt to assign array value to non-array ```. It trips over a local array which is not properly declared. --- themes/agnoster.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'themes/agnoster.zsh-theme') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index d1a69c560..18496c2bc 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -212,8 +212,8 @@ prompt_virtualenv() { # - am I root # - are there background jobs? prompt_status() { - local symbols - symbols=() + local -a symbols=() + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘" [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" -- cgit v1.2.3-70-g09d2 From a3d13eb76a19bbe18b6b843232695645bd9aa632 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 26 Sep 2018 17:19:59 +0200 Subject: fix invalid syntax in old zsh versions --- themes/agnoster.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes/agnoster.zsh-theme') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 18496c2bc..71ecf2b36 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -212,7 +212,7 @@ prompt_virtualenv() { # - am I root # - are there background jobs? prompt_status() { - local -a symbols=() + local -a symbols [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘" [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" -- cgit v1.2.3-70-g09d2