-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Be more restrictive with bash init fallback #278
Conversation
Git for Windows 2.22.0 and 2.23.0 (the latest) both ship with bash: Sadly there is some regression in 2.23.0, because Bash 4.4.23 seems to have been around since 2.22.0 (December 2018), and Bash 4.4.x for numerous years before that. |
@chipbuster - Do you think we should take the Based on the versions of Git Bash I mentioned in the previous comment, v4.1 as a minimum should be suitable for everyone who has installed/updated Git for Windows in the last few years. Edit: As an aside, if you're OK with this as a plan, I'll update this PR to add a few more comments around this check |
@nickwb I think that's probably the best way to go here. It won't be perfect, but we'll be supporting a lot more configurations than we are now. |
This should improve compatibility with "Git Bash" with Git for Windows.
@chipbuster - Ok, I've pushed an update as discussed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed comment!
Gotta be honest, it still weirds me out a bit that neither method works for bash-4.0, but we'll cross that bridge if we come to it.
Changes the bash init fallback to be
Major Version > 3
rather thanMajor Version > 4
.Description
The issue being worked around affects bash 3.2, so
Major Version > 3
is sufficient.The fallback requires
/dev/stdin
, which may not exist on all systems - so it's preferable to use the normal bootstrap when possible.This should fix starship for some Windows users who are using bash without full POSIX emulation.
For example: Git Bash, which is part of Git for Windows, does not recognise
/dev/stdin
, but does ship with bash 4.x.Motivation and Context
Improve support for starship on Windows 馃槂
Bash on Windows is a bit of a minefield, because there are various projects maintaining various POSIX emulation layers and various patch lists. This change will not fix starship for ALL bash users on windows, but it should fix it for a portion of them.
Types of changes
How Has This Been Tested?
(I did specifically test this on bash 3.2 on MacOS).
Checklist: