Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Modules not working in fish RPROMPT #3146

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

andytom
Copy link
Member

@andytom andytom commented Oct 10, 2021

Description

This should fix some modules not working correctly in the fish
RPROMPT. I have done this the very naive way by simply duplicating the
code that is currently in the fish_prompt function to avoid having to
change the scope of any of the variables (currently all local) but happy to
change this if someone has a better suggestion.

Motivation and Context

Closes #3137

Screenshots (if appropriate):

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux
  • I have tested using Windows

Checklist:

  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

This should fix some modules not working correctly in the fish
`RPROMPT`. I have done this the very naive way by simply duplicating the
code that is currently in the `fish_prompt` function to avoid having to
change the scope of any of the variables (currently all local).
@andytom andytom requested a review from a team October 10, 2021 09:20
@davidkna
Copy link
Member

Is it possible to just change the visibility of the variables in the first fish_prompt function instead?

@andytom
Copy link
Member Author

andytom commented Oct 13, 2021

Is it possible to just change the visibility of the variables in the first fish_prompt function instead?

I thought of that but wasn't sure if fiah_prompt is always executed before fish_right_prompt or there is some case where either fish_right_prompt is executed without fish_prompt or it is executed first.

case '*'
set STARSHIP_KEYMAP insert
end
set STARSHIP_CMD_STATUS $status
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status is still always 0 for me, even with this change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested again, and it seems to work when I disabled other shell hooks.

@andytom andytom merged commit c682329 into starship:master Oct 22, 2021
@andytom andytom deleted the fix/rprompt_fish branch October 22, 2021 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Variables not working in right_format
2 participants