From 83d11394321398b99911089901b905574807ccfb Mon Sep 17 00:00:00 2001 From: Rob Lugton Date: Sun, 24 Mar 2019 05:20:28 +1100 Subject: agnoster: show AWS_PROFILE in prompt (#6621) --- themes/agnoster.zsh-theme | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'themes/agnoster.zsh-theme') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 0edb773aa..3c30a9e11 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -224,11 +224,25 @@ prompt_status() { [[ -n "$symbols" ]] && prompt_segment black default "$symbols" } +#AWS Profile: +# - display current AWS_PROFILE name +# - displays yellow on red if profile name contains 'production' or +# ends in '-prod' +# - displays black on green otherwise +prompt_aws() { + [[ -z "$AWS_PROFILE" ]] && return + case "$AWS_PROFILE" in + *-prod|*production*) prompt_segment red yellow "AWS: $AWS_PROFILE" ;; + *) prompt_segment green black "AWS: $AWS_PROFILE" ;; + esac +} + ## Main prompt build_prompt() { RETVAL=$? prompt_status prompt_virtualenv + prompt_aws prompt_context prompt_dir prompt_git -- cgit v1.2.3-70-g09d2 From 8db0f352e80b9a77f95ea31196208686ac1db3e6 Mon Sep 17 00:00:00 2001 From: David Dejori <44683433+dejdav@users.noreply.github.com> Date: Thu, 18 Apr 2019 18:27:21 +0200 Subject: agnoster: remove empty line (#7775) --- themes/agnoster.zsh-theme | 1 - 1 file changed, 1 deletion(-) (limited to 'themes/agnoster.zsh-theme') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 3c30a9e11..518a14a37 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -152,7 +152,6 @@ prompt_bzr() { if [[ $status_all -gt 0 ]] ; then prompt_segment yellow black echo -n "bzr@"$revision - else prompt_segment green black echo -n "bzr@"$revision -- cgit v1.2.3-70-g09d2 From 59c1ec80aa9b018db34078e69a27e57aea5ad761 Mon Sep 17 00:00:00 2001 From: Rocky Date: Wed, 31 Jul 2019 01:23:50 -0600 Subject: agnoster: fix VIRTUAL_ENV_DISABLE_PROMPT logic (#8050) Fixes #7985 --- 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 518a14a37..7e37440a4 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -204,7 +204,7 @@ prompt_dir() { # Virtualenv: current working virtualenv prompt_virtualenv() { local virtualenv_path="$VIRTUAL_ENV" - if [[ -n $virtualenv_path && -n $VIRTUAL_ENV_DISABLE_PROMPT ]]; then + if [[ -n $virtualenv_path && -z $VIRTUAL_ENV_DISABLE_PROMPT ]]; then prompt_segment blue black "(`basename $virtualenv_path`)" fi } -- cgit v1.2.3-70-g09d2 From 89366be43fd6ceff52a9da2f2edef654ab619514 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 6 Aug 2019 18:01:32 +0200 Subject: Revert "agnoster: fix VIRTUAL_ENV_DISABLE_PROMPT logic (#8050)" (#8061) This reverts commit 59c1ec80aa9b018db34078e69a27e57aea5ad761. --- 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 7e37440a4..518a14a37 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -204,7 +204,7 @@ prompt_dir() { # Virtualenv: current working virtualenv prompt_virtualenv() { local virtualenv_path="$VIRTUAL_ENV" - if [[ -n $virtualenv_path && -z $VIRTUAL_ENV_DISABLE_PROMPT ]]; then + if [[ -n $virtualenv_path && -n $VIRTUAL_ENV_DISABLE_PROMPT ]]; then prompt_segment blue black "(`basename $virtualenv_path`)" fi } -- cgit v1.2.3-70-g09d2