From 4065c605d2fd866101653e7e71ef5294fbbeadc9 Mon Sep 17 00:00:00 2001 From: Eugene Brodsky Date: Wed, 17 Sep 2014 15:04:51 -0400 Subject: [PATCH] removes AWS profile from RPROMPT and adds a function to make this available to themes --- plugins/aws/aws.plugin.zsh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 8b57d7db1..fc8d0a39f 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -14,9 +14,16 @@ function agp { } function asp { export AWS_DEFAULT_PROFILE=$1 - export RPROMPT="" - } + +# Makes AWS profile info available to shell prompt. Inspired by git_prompt_info() +function aws_prompt_info { + if [[ -n $(echo $AWS_DEFAULT_PROFILE) ]]; + then + echo "$ZSH_THEME_AWS_PROFILE_PREFIX$AWS_DEFAULT_PROFILE$ZSH_THEME_AWS_PROFILE_SUFFIX" + fi +} + function aws_profiles { reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/')) }