浏览代码

Fix showing aws prompt out of the box for 'fishy' theme (#7747)

This fixes the RPROMPT setting for fishy theme so as to preserve its old value,
instead of overwriting it like it did before.

Also, fix unnecessary export of RPROMPT in aws plugin.
Marc Cornellà 6 年之前
父节点
当前提交
0c3499ecd9
共有 3 个文件被更改,包括 4 次插入2 次删除
  1. 2 0
      plugins/aws/README.md
  2. 1 1
      plugins/aws/aws.plugin.zsh
  3. 1 1
      themes/fishy.zsh-theme

+ 2 - 0
plugins/aws/README.md

@@ -25,6 +25,8 @@ plugins=(... aws)
 ## Plugin options
 ## Plugin options
 
 
 * Set `SHOW_AWS_PROMPT=false` in your zshrc file if you want to prevent the plugin from modifying your RPROMPT.
 * Set `SHOW_AWS_PROMPT=false` in your zshrc file if you want to prevent the plugin from modifying your RPROMPT.
+  Some themes might overwrite the value of RPROMPT instead of appending to it, so they'll need to be fixed to
+  see the AWS profile prompt.
 
 
 ## Theme
 ## Theme
 
 

+ 1 - 1
plugins/aws/aws.plugin.zsh

@@ -44,7 +44,7 @@ function aws_prompt_info() {
 }
 }
 
 
 if [ "$SHOW_AWS_PROMPT" != false ]; then
 if [ "$SHOW_AWS_PROMPT" != false ]; then
-  export RPROMPT='$(aws_prompt_info)'"$RPROMPT"
+  RPROMPT='$(aws_prompt_info)'"$RPROMPT"
 fi
 fi
 
 
 
 

+ 1 - 1
themes/fishy.zsh-theme

@@ -14,7 +14,7 @@ PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>)
 PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
 PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
 
 
 local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
 local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
-RPROMPT='${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
+RPROMPT="${RPROMPT}"'${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
 
 
 ZSH_THEME_GIT_PROMPT_PREFIX=" "
 ZSH_THEME_GIT_PROMPT_PREFIX=" "
 ZSH_THEME_GIT_PROMPT_SUFFIX=""
 ZSH_THEME_GIT_PROMPT_SUFFIX=""