From afa8dc46ecb1babda7db8fb8228224e8975e95f4 Mon Sep 17 00:00:00 2001 From: Carlo Dapor Date: Tue, 25 Sep 2018 21:46:27 +0200 Subject: [PATCH 1/2] 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(-) 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}%}⚙" From a3d13eb76a19bbe18b6b843232695645bd9aa632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 26 Sep 2018 17:19:59 +0200 Subject: [PATCH 2/2] fix invalid syntax in old zsh versions --- themes/agnoster.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}%}⚡"