Skip to content

Avit Theme does not work well with AWS Plugin #10307

Closed
@slessardjr

Description

The AWS plugin will automatically add the aws_prompt_info to the RPROMPT of the shell theme. The Avit theme currently sets RPROMPT effectively removing the plugins feature of adding itself to the prompt.

As seen by the snippit here, the plugin sets itself to pompt.

if [[ "$SHOW_AWS_PROMPT" != false && "$RPROMPT" != *'$(aws_prompt_info)'* ]]; then
RPROMPT='$(aws_prompt_info)'"$RPROMPT"
fi

But since the theme sets RPROMPT, it will override this. What I think should happen to keep the compatibility is to change the following line

RPROMPT='$(vi_mode_prompt_info)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'

to

__RPROMPT='$(vi_mode_prompt_info)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
if [[ -z $RPROMPT ]]; then
  RPROMPT=$__RPROMPT
else
  RPROMPT="${RPROMPT} ${__RPROMPT}"  
fi

This would allow plugins to add themselves to the prompt without having to add RPROMPT overrides in .zshrc or to edit the theme file directly.

Metadata

Assignees

No one assigned

    Labels

    Area: themeIssue or PR related to a theme

    Type

    No type

    Projects

    • Status

      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions