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: Correctly detect older versions of powershell in bug-report #3543

Merged
merged 2 commits into from Feb 3, 2022

Conversation

chipbuster
Copy link
Contributor

@chipbuster chipbuster commented Jan 31, 2022

Description

Will lead to correct detection of older versions of powershell using starship bug-report. Special-cases the version code on powershell (can be extended to any shell, but all the others support --version for now).

Has been tested in a Windows VM against powershell 5.1 and the most recent version of pwsh available on the store.

Motivation and Context

Closes #3531

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.

@chipbuster chipbuster marked this pull request as ready for review January 31, 2022 20:41
@chipbuster
Copy link
Contributor Author

An interesting point I discovered while testing this: bug-report currently assumes that you've already run starship init in order to get its shell info. Given that we're not in a performance-constrained path, it might be an interesting project to use some sort of process information (e.g. chase the implicit parent-process-linked-list) to try to find shell information.

@andytom andytom merged commit 5efb78b into starship:master Feb 3, 2022
@andytom
Copy link
Member

andytom commented Feb 3, 2022

Thank you for your contribution @chipbuster and thank you for the review @davidkna .

Perniciosius pushed a commit to Perniciosius/starship that referenced this pull request Feb 21, 2022
…rship#3543)

* Factor out the shell version function

* Correct command to trim spaces + header
@chipbuster chipbuster deleted the detect-powershell-version branch May 18, 2022 04:25
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.

Starship bug-report doesn't detect powershell version correctly
3 participants