-
Notifications
You must be signed in to change notification settings - Fork 613
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
git-prompt: fully enable the PS1 prompt on the SDK #122
Conversation
The SDK installation, at some point, overwrites the /etc/bash.bashrc file and now detects a $MSYS2_PS1 prompt as an alternative to setting a default PS1 prompt. Any pre-prepared PS1 is overwritten. Provide that alternate environment variable. The Git-for-Windows installation does not use that version of the /etc/bash.bashrc file, so is unaffected. Signed-off-by: Philip Oakley <philipoakley@iee.org>
This is a partial solution to git-for-windows/git#794 (comment) where the title prefix and prompt isn't set as would be expected. I don't know enough about pqcman and how to debug it to find out which package overwrites the /etc/bash.bashrc file during the SDK install, nor whether it's part of a base package or a patch to the package (and how to determine those) |
Thanks! I had to run an |
@dscho, Thanks for the merge. Sorry I wasn't aware about the I'll still keep looking at how to find out which package did the dirty deed of updating the |
Sorry, I meant to clarify that earlier... It is a bit inelegant, as |
The title bar in Git for Windows' SDK [shows the correct prefix again](#122). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
If I read that correctly, you are simply changing the What I'm seeing (but not understanding) is that by the time the full SDK has I'm thinking that maybe I need to add a trigger/hook to the pacman stuff Philip |
Heh. I should clarify. A previous Now, I missed the fact that newer versions of the That means that I am very, very grateful for your report on this: I would have missed this breakage otherwise. And finally, I think your Well, maybe somebody wants to override the So I think your PR already fixes things appropriately. A follow-up PR might want to remove the |
@dscho, Thanks for that clarification. However we may be talking at cross purposes. First can you confirm what you see in your bash.bashrc for the SDK. Note that I select the 'only use the bash for git' (the most safe ;-) What I see in mine is
Which is nothing like what's in the base filesystem package (the self extracting exe), which you modify for the normal G4W. I was trying to find out how my bas.bashrc got that way. (and then patch the |
Yes, I can see the same now.
Actually, it is... see the output of tar Oxvf /var/cache/packman/pkg/filesystem-2016.05-3-x86_64.pkg.tar.xz etc/bash.bashrc
I think the most logical update to |
Odd that. I thought I'd looked at that file (the 32bit version) from the interweb and did not see it (the msys2_ps1 check) in the one I got. I'll double check what I'm seeing just to make sure I'm looking at the right thing, and then consider an upstream report. Goes and checks.... Not got time to check the web source just now (weekend away - yay) |
Found it. I'd taken a wrong turn in drilling down the many layers and had ended up in the BASE side of the packages. |
Setting this variable now makes /etc/bash.bashrc use that as PS1 instead of default value. This allows for configuration shared between MSYS2 and other environments like Cygwin or MinGW.org MSYS to define a PS1 that is specific to MSYS2 without manual detection of the system type.
Thanks for digging! |
6e6310d (filesystem: New specific variable MSYS2_PS1., 2016-05-01) introduced the MSYS2_PS1 prompt script proriority to allow multiple device configurations. Unfortunately it overwrote the $PS1, even when specifically set by the users configuration, such as the Git-for-Windows SDK see git-for-windows/git#794 (comment) and the monkey patch fix git-for-windows/build-extra#122. Introduce a priority order so that the user's $PS1 (if set) has an intermediate priority between the MSYS2_PS1 and the default PS1. Signed-off-by: Philip Oakley <philipoakley@iee.org>
I have posted an upstream patch as well msys2/MSYS2-packages#651 |
6e6310d (filesystem: New specific variable MSYS2_PS1., 2016-05-01) introduced the MSYS2_PS1 prompt script proriority to allow multiple device configurations. Unfortunately it overwrote the $PS1, even when specifically set by the users configuration, such as the Git-for-Windows SDK see git-for-windows/git#794 (comment) and the monkey patch fix git-for-windows/build-extra#122. Introduce a priority order so that the user's $PS1 (if set) has an intermediate priority between the MSYS2_PS1 and the default PS1. Signed-off-by: Philip Oakley <philipoakley@iee.org>
@dscho The upstream fix PhilipOakley/MSYS2-packages@4ce39dd is now in place! |
|
No worries! Thanks for the update! |
6e6310d (filesystem: New specific variable MSYS2_PS1., 2016-05-01) introduced the MSYS2_PS1 prompt script priority to allow multiple device configurations. Unfortunately, if MSYS2_PS1 was not set it overwrote the $PS1, even when specifically set by the users configuration, such as provided in the Git-for-Windows SDK (see git-for-windows/git#794 (comment)) and the monkey patch fix (git-for-windows/build-extra#122). Introduce a priority order so that the user's $PS1 (if set) has an intermediate priority between the MSYS2_PS1 and the default PS1. Signed-off-by: Philip Oakley <philipoakley@iee.org>
@dscho I thought I'd done a fix (msys2/MSYS2-packages#651) to the upstream (worked for me), but apparently not, so a follow up fix msys2/MSYS2-packages#654 is now in place. And it appears to work for me (for the SDK). Keep an eye out for any issues |
The SDK installation, at some point, overwrites the /etc/bash.bashrc file
and now detects a $MSYS2_PS1 prompt as an alternative to setting a default
PS1 prompt. Any pre-prepared PS1 is overwritten.
Provide that alternate environment variable.
The Git-for-Windows installation does not use that version of the
/etc/bash.bashrc file, so is unaffected.
Signed-off-by: Philip Oakley philipoakley@iee.org