Better support Bash 4.4 by moving default prompt to GIT_PROMPT #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was vexed that the un-parsed prompt was always showing before any command was executed in my home laptop, while everything worked perfectly on all my work machines.
Then I found that, as of Bash 4.4, there's a real PS0 -- and it runs before the terminal command is executed.
Rewrote this script to prefer GIT_PROMPT but fall back to PS0 for people not on Bash 4.4. It'll still be annoying for anyone who upgrades their Bash, but there's not much to be done -- I spent a while trying to reliably tell what shell the user was in, but found I could reliably trick perl by having subshells run Bash 3.2.
PR updates documentation as well.